/* ============================================================
   知识库悬浮功能（悬浮球 + 悬浮窗）
   配色与主工作台一致：暖陶土 / 米白纸感（见 style.css 的 --wb-* 变量）
   ============================================================ */

/* ---------- 悬浮球 ---------- */
.kb-fab {
    position: fixed;
    right: 26px;
    bottom: 26px;
    z-index: 970; /* 高于悬浮窗遮罩(950)，窗口打开时仍可切换菜单 */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    /* 容器自身不拦截鼠标：容器里还包括收起状态(透明)的菜单区域，
       若不放行，小窗口时这块隐形区域会挡住右下角的页面按钮（上一周/刷新/添加任务等）。
       只让球和展开后的菜单项接收点击。 */
    pointer-events: none;
}
.kb-fab-btn,
.kb-fab.open .kb-fab-menu { pointer-events: auto; }
.kb-fab-btn {
    position: relative; /* 呼吸圈定位基准，必须以按钮自身为参照，否则会按 .kb-fab 容器撑成椭圆 */
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: linear-gradient(145deg, #b4694a, #96502f);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(163, 90, 59, .38), 0 2px 5px rgba(0, 0, 0, .12);
    transition: transform .22s ease, box-shadow .22s ease;
}
.kb-fab-btn:hover { transform: translateY(-2px); box-shadow: 0 9px 22px rgba(163, 90, 59, .45); }
.kb-fab-btn svg { width: 25px; height: 25px; transition: transform .3s ease; }
.kb-fab.open .kb-fab-btn svg { transform: rotate(90deg); }
.kb-fab-btn::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 54px;
    height: 54px;
    margin: -27px 0 0 -27px;
    border-radius: 50%;
    border: 1.5px solid rgba(163, 90, 59, .28);
    animation: kb-pulse 2.6s ease-out infinite;
    pointer-events: none;
}
@keyframes kb-pulse {
    0%   { transform: scale(.92); opacity: .9; }
    70%  { transform: scale(1.22); opacity: 0; }
    100% { transform: scale(1.22); opacity: 0; }
}

/* 悬浮菜单 */
.kb-fab-menu {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    opacity: 0;
    transform: translateY(8px) scale(.96);
    pointer-events: none;
    visibility: hidden; /* 收起时彻底退出命中测试，双保险 */
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.kb-fab.open .kb-fab-menu { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
.kb-fab-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px 10px 12px;
    background: var(--wb-card, #fbf8f2);
    border: 1px solid var(--wb-border, #e9e2d5);
    border-radius: 13px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--wb-text, #33302b);
    box-shadow: 0 4px 14px rgba(51, 48, 43, .12);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    white-space: nowrap;
}
.kb-fab-item:hover {
    transform: translateX(-3px);
    border-color: var(--wb-accent-soft, #c0896d);
    box-shadow: 0 6px 16px rgba(163, 90, 59, .2);
}
.kb-fab-item-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.kb-fab-item-icon svg { width: 16px; height: 16px; }
.kb-fab-item small { display: block; font-weight: 400; font-size: 11px; color: var(--wb-muted, #a89f92); margin-top: 1px; }
.kb-fab-item-icon.graph { background: #f3e6dd; color: #a35a3b; }
.kb-fab-item-icon.script { background: #f0eaf6; color: #8f6fae; }
.kb-fab-item-icon.bind { background: #e8edf4; color: #5f7d9c; }
.kb-fab-item-icon.guide { background: #e9efe2; color: #71895a; }

/* ---------- 悬浮窗（通用） ---------- */
.kb-backdrop {
    position: fixed;
    inset: 0;
    z-index: 950;
    /* 注意：这里绝对不要加 backdrop-filter: blur()。
       全屏 backdrop-filter 会让下层每帧重新做一次全屏模糊合成，
       图谱画布每次重绘都会触发它，实测帧时间从 16.7ms 涨到 56.8ms（16fps）。
       去掉后靠略深的底色维持同样的遮罩层次。 */
    background: rgba(46, 44, 40, .42);
    animation: kb-fade .18s ease;
}
@keyframes kb-fade { from { opacity: 0; } to { opacity: 1; } }

/* 悬浮窗打开时，暂停背后页面的动画。
   背景被半透明遮罩盖住本来就看不见，但它的动画仍在每帧重绘整页，
   会把合成器拖慢，连带图谱也跟着掉帧。 */
body.kb-modal-open > *:not(.kb-win):not(.kb-backdrop),
body.kb-modal-open > *:not(.kb-win):not(.kb-backdrop) * {
    animation-play-state: paused !important;
}

.kb-win {
    position: fixed;
    z-index: 960;
    display: flex;
    flex-direction: column;
    background: var(--wb-bg, #f4efe6);
    border: 1px solid var(--wb-border-strong, #ddd4c4);
    border-radius: var(--wb-radius, 16px);
    box-shadow: 0 24px 60px rgba(30, 26, 20, .35);
    overflow: hidden;
    animation: kb-win-in .22s ease;
}
@keyframes kb-win-in {
    from { opacity: 0; transform: translateY(14px) scale(.985); }
    to   { opacity: 1; transform: none; }
}

/* 标题栏（拖拽把手） */
.kb-titlebar {
    height: 46px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px 0 16px;
    background: var(--wb-card, #fbf8f2);
    border-bottom: 1px solid var(--wb-border, #e9e2d5);
    cursor: move;
    user-select: none;
}
.kb-titlebar-icon {
    width: 26px; height: 26px;
    border-radius: 8px;
    background: #f3e6dd;
    color: #a35a3b;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.kb-titlebar-icon svg { width: 15px; height: 15px; }
.kb-titlebar-title { font-size: 14px; font-weight: 700; color: var(--wb-text, #33302b); }
.kb-titlebar-sub {
    font-size: 11px;
    color: var(--wb-muted, #a89f92);
    margin-left: 2px;
    padding-left: 10px;
    border-left: 1px solid var(--wb-border, #e9e2d5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kb-titlebar-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.kb-tbtn {
    width: 28px; height: 28px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--wb-text-2, #6f685e);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s ease, color .15s ease;
}
.kb-tbtn:hover { background: #eee7da; color: var(--wb-text, #33302b); }
.kb-tbtn.close:hover { background: #e8d5cb; color: #a35a3b; }
.kb-tbtn svg { width: 15px; height: 15px; }

/* 内容区 */
.kb-body {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 缩放把手 */
.kb-resize {
    position: absolute;
    right: 0; bottom: 0;
    width: 18px; height: 18px;
    cursor: nwse-resize;
    z-index: 20;
}
.kb-resize::after {
    content: '';
    position: absolute;
    right: 4px; bottom: 4px;
    width: 8px; height: 8px;
    border-right: 2px solid var(--wb-border-strong, #ddd4c4);
    border-bottom: 2px solid var(--wb-border-strong, #ddd4c4);
    border-radius: 0 0 3px 0;
}
.kb-win.max .kb-resize { display: none; }
.kb-win.max .kb-titlebar { cursor: default; }

/* ============================================================
   知识库图谱视图
   ============================================================ */
.kb-graph { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* 顶部工具栏 */
.kb-toolbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--wb-card, #fbf8f2);
    border-bottom: 1px solid var(--wb-border, #e9e2d5);
    flex-wrap: wrap;
}
.kb-search {
    height: 32px;
    width: 250px;
    padding: 0 14px;
    border: 1px solid var(--wb-border-strong, #ddd4c4);
    border-radius: 16px;
    font-size: 13px;
    font-family: inherit;
    color: var(--wb-text, #33302b);
    background: #fffdf9;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.kb-search:focus { border-color: var(--wb-accent, #a35a3b); box-shadow: 0 0 0 3px rgba(163, 90, 59, .1); }
.kb-search::placeholder { color: var(--wb-muted, #a89f92); }
.kb-hint { font-size: 11px; color: var(--wb-muted, #a89f92); white-space: nowrap; }

.kb-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.kb-chip {
    height: 26px;
    padding: 0 12px;
    border: 1px solid var(--wb-border-strong, #ddd4c4);
    border-radius: 13px;
    background: transparent;
    font-size: 11px;
    font-family: inherit;
    font-weight: 600;
    color: var(--wb-text-2, #6f685e);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all .15s ease;
}
.kb-chip .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.kb-chip:hover { border-color: var(--wb-accent-soft, #c0896d); color: var(--wb-text, #33302b); }
.kb-chip.on { background: var(--wb-accent, #a35a3b); border-color: var(--wb-accent, #a35a3b); color: #fff; }
.kb-chip.on .dot { background: #fff !important; }

.kb-tb-btn {
    height: 30px;
    padding: 0 13px;
    border: 1px solid var(--wb-border-strong, #ddd4c4);
    border-radius: 9px;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    color: var(--wb-text-2, #6f685e);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .15s ease;
    flex-shrink: 0;
}
.kb-tb-btn:hover { background: #f1ead0; color: var(--wb-text, #33302b); }
.kb-tb-btn svg { width: 13px; height: 13px; }
.kb-tb-btn.spinning svg { animation: kb-spin .9s linear infinite; }
@keyframes kb-spin { to { transform: rotate(360deg); } }

/* 图例 */
.kb-legend { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.kb-legend-overlay {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 6;
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
    max-width: calc(100% - 24px);
    padding: 8px 12px;
    background: rgba(251, 248, 242, .94);
    border: 1px solid var(--wb-border, #e9e2d5);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(51, 48, 43, .06);
    pointer-events: none;
}
.kb-lg-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--wb-text-2, #6f685e); }
.kb-lg-item .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.kb-lg-item .sq { width: 10px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.kb-lg-item .hex { width: 10px; height: 10px; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%); flex-shrink: 0; }
.kb-lg-item .dia { width: 8px; height: 8px; transform: rotate(45deg); border-radius: 1.5px; flex-shrink: 0; }

/* 主体三栏：品牌列表 | 画布 | 详情 */
.kb-main { flex: 1; min-height: 0; display: flex; }

/* 左侧品牌列表 */
.kb-brands {
    width: 190px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--wb-card, #fbf8f2);
    border-right: 1px solid var(--wb-border, #e9e2d5);
}
.kb-bp-head {
    padding: 10px 12px 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--wb-text, #33302b);
    border-bottom: 1px solid var(--wb-line, #f0ebe1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.kb-bp-head em { font-style: normal; font-size: 10px; font-weight: 400; color: var(--wb-muted, #a89f92); }
.kb-bp-search { padding: 6px 10px; border-bottom: 1px solid var(--wb-line, #f0ebe1); }
.kb-bp-search input {
    width: 100%;
    height: 26px;
    padding: 0 10px;
    border: 1px solid var(--wb-border, #e9e2d5);
    border-radius: 13px;
    font-size: 12px;
    font-family: inherit;
    outline: none;
    background: #fffdf9;
    color: var(--wb-text, #33302b);
}
.kb-bp-search input:focus { border-color: var(--wb-accent, #a35a3b); }
.kb-bp-list-wrap { flex: 1; position: relative; overflow: hidden; }
.kb-bp-list { position: absolute; inset: 0; overflow-y: auto; padding-right: 26px; }
.kb-bp-letter {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 3px 12px;
    background: var(--wb-tile, #f2ece2);
    font-size: 10px;
    font-weight: 700;
    color: var(--wb-accent, #a35a3b);
    border-bottom: 1px solid var(--wb-line, #f0ebe1);
    letter-spacing: 1px;
}
.kb-bp-item {
    padding: 6px 12px;
    border-bottom: 1px solid var(--wb-line, #f0ebe1);
    cursor: pointer;
    font-size: 12px;
    color: var(--wb-text, #33302b);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    transition: background .12s ease;
}
.kb-bp-item:hover { background: #f6ede4; }
.kb-bp-item.active { background: #f0e0d3; font-weight: 700; color: var(--wb-accent, #a35a3b); }
.kb-bp-item .kb-bp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-bp-item .kb-bp-note { font-size: 10px; color: #b08d4f; flex-shrink: 0; font-weight: 400; }
.kb-bp-item .cnt { font-size: 10px; color: var(--wb-muted, #a89f92); font-weight: 400; }
.kb-bp-empty { padding: 16px 12px; font-size: 12px; color: var(--wb-muted, #a89f92); }
.kb-bp-alpha {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(251, 248, 242, .95);
    border-left: 1px solid var(--wb-line, #f0ebe1);
    z-index: 5;
    padding: 4px 0;
    user-select: none;
}
.kb-bp-alpha span {
    font-size: 10px;
    line-height: 1.05;
    color: var(--wb-muted, #a89f92);
    cursor: pointer;
    width: 24px;
    text-align: center;
    padding: 1.5px 0;
    border-radius: 4px;
    font-weight: 700;
    transition: background .1s ease, color .1s ease;
}
.kb-bp-alpha span:hover { background: var(--wb-accent, #a35a3b); color: #fff; }
.kb-bp-alpha span.on { background: var(--wb-accent, #a35a3b); color: #fff; }

/* 画布 */
.kb-canvas-wrap { flex: 1; min-width: 0; position: relative; background: var(--wb-bg, #f4efe6); }
.kb-canvas { position: absolute; inset: 0; }
.kb-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 10;
    background: rgba(244, 239, 230, .8);
    font-size: 13px;
    color: var(--wb-text-2, #6f685e);
    transition: opacity .3s ease;
}
.kb-loading.hidden {
    opacity: 0;
    pointer-events: none;
    /* 淡出后必须把它彻底移出绘制树：原来只设了 opacity:0，
       这个覆盖整块画布的半透明层会一直留在合成层里，里面的 spinner 还在无限旋转，
       图谱每重绘一帧都要带着它一起合成。 */
    visibility: hidden;
    transition: opacity .3s ease, visibility 0s linear .3s;
}
.kb-loading.hidden .spin { animation: none; }
.kb-loading .spin {
    width: 30px; height: 30px;
    border: 3px solid var(--wb-border-strong, #ddd4c4);
    border-top-color: var(--wb-accent, #a35a3b);
    border-radius: 50%;
    animation: kb-spin .8s linear infinite;
}
.kb-canvas-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 11;
    background: var(--wb-bg, #f4efe6);
    text-align: center;
    padding: 20px;
}
.kb-canvas-error .big { font-size: 34px; }
.kb-canvas-error p { font-size: 13px; color: var(--wb-text-2, #6f685e); max-width: 420px; line-height: 1.7; }
.kb-retry-btn {
    height: 34px;
    padding: 0 20px;
    border: none;
    border-radius: 10px;
    background: var(--wb-accent, #a35a3b);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}
.kb-retry-btn:hover { background: #96502f; }

/* 右侧详情 */
.kb-detail {
    width: 300px;
    flex-shrink: 0;
    background: var(--wb-card, #fbf8f2);
    border-left: 1px solid var(--wb-border, #e9e2d5);
    overflow-y: auto;
}
.kb-dt-placeholder { padding: 24px 18px; font-size: 12px; line-height: 1.9; color: var(--wb-muted, #a89f92); }
.kb-dt-head {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 12px 14px;
    background: var(--wb-card, #fbf8f2);
    border-bottom: 1px solid var(--wb-line, #f0ebe1);
}
.kb-dt-head h3 {
    margin: 0;
    font-size: 15px;
    color: var(--wb-text, #33302b);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}
.kb-dt-head .cnt { font-size: 11px; color: var(--wb-muted, #a89f92); margin-top: 3px; }
.kb-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: .5px;
}
.kb-dt-sec { padding: 10px 14px; border-bottom: 1px solid var(--wb-line, #f0ebe1); }
.kb-dt-kv { display: flex; gap: 8px; padding: 5px 0; font-size: 12px; align-items: baseline; }
.kb-dt-kv .k { width: 62px; flex-shrink: 0; color: var(--wb-muted, #a89f92); }
.kb-dt-kv .v { flex: 1; color: var(--wb-text, #33302b); word-break: break-all; line-height: 1.6; }
.kb-dt-chips { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
.kb-dt-chip {
    padding: 2.5px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: opacity .15s ease, transform .15s ease;
}
.kb-dt-chip:hover { opacity: .85; transform: translateY(-1px); }
.kb-dt-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 11px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 700;
}
.kb-dt-status .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.kb-dt-item {
    padding: 9px 14px;
    border-bottom: 1px solid var(--wb-line, #f0ebe1);
    cursor: pointer;
    transition: background .12s ease;
}
.kb-dt-item:hover { background: #f6ede4; }
.kb-dt-item .r1 { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--wb-text, #33302b); }
.kb-dt-item .r2 { font-size: 11px; color: var(--wb-muted, #a89f92); margin-top: 2px; line-height: 1.6; }
.kb-dt-item .meta { font-size: 10px; color: var(--wb-muted, #a89f92); font-weight: 400; }
.kb-dt-note {
    margin: 8px 14px;
    padding: 8px 12px;
    background: var(--wb-tile, #f2ece2);
    border-radius: 9px;
    font-size: 11px;
    line-height: 1.7;
    color: var(--wb-text-2, #6f685e);
}

/* 备注块（品牌 / 型号，可编辑） */
.kb-note-sec {
    margin: 10px 14px;
    padding: 9px 12px 10px;
    background: #fff;
    border: 1px solid var(--wb-border, #e9e2d5);
    border-radius: 10px;
}
.kb-note-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.kb-note-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--wb-text-2, #6f685e);
    letter-spacing: .3px;
}
.kb-note-edit,
.kb-note-cancel {
    border: 1px solid var(--wb-border-strong, #ddd4c4);
    background: #fff;
    color: var(--wb-text-2, #6f685e);
    font-family: inherit;
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 999px;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease;
}
.kb-note-edit:hover,
.kb-note-cancel:hover { border-color: var(--wb-accent, #a35a3b); color: var(--wb-accent, #a35a3b); }
.kb-note-ro {
    font-size: 10px;
    color: var(--wb-muted, #a89f92);
    background: var(--wb-tile, #f2ece2);
    padding: 1px 8px;
    border-radius: 999px;
}
.kb-note-text {
    font-size: 12px;
    line-height: 1.75;
    color: var(--wb-text, #33302b);
    word-break: break-word;
}
.kb-note-empty { font-size: 11px; color: var(--wb-muted, #a89f92); }
.kb-note-ta {
    width: 100%;
    min-height: 78px;
    box-sizing: border-box;
    resize: vertical;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.7;
    color: var(--wb-text, #33302b);
    background: var(--wb-tile, #f7f4ee);
    border: 1px solid var(--wb-border-strong, #ddd4c4);
    border-radius: 8px;
    padding: 7px 9px;
    outline: none;
    transition: border-color .15s ease, background .15s ease;
}
.kb-note-ta:focus { border-color: var(--wb-accent, #a35a3b); background: #fff; }
.kb-note-actions { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.kb-note-save {
    border: none;
    background: linear-gradient(145deg, #b4694a, #96502f);
    color: #fff;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 999px;
    cursor: pointer;
}
.kb-note-save:disabled { opacity: .6; cursor: default; }
.kb-note-tip { font-size: 11px; color: #71895a; }
.kb-note-tip.err { color: #c0392b; }

/* ============================================================
   安装教程视图
   ============================================================ */
.kb-guide { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 26px 30px; }
.kb-guide-inner { max-width: 860px; margin: 0 auto; }
.kb-gd-sec { margin-bottom: 26px; }
.kb-gd-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--wb-text, #33302b);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.kb-gd-title::before {
    content: '';
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: var(--wb-accent, #a35a3b);
}
.kb-gd-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kb-gd-stat {
    background: var(--wb-card, #fbf8f2);
    border: 1px solid var(--wb-border, #e9e2d5);
    border-radius: var(--wb-radius-sm, 10px);
    padding: 14px 16px;
    text-align: center;
}
.kb-gd-stat .num { font-family: Georgia, serif; font-size: 26px; font-weight: 700; color: var(--wb-accent, #a35a3b); line-height: 1; }
.kb-gd-stat .lbl { font-size: 11px; color: var(--wb-muted, #a89f92); margin-top: 4px; }
.kb-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; counter-reset: kb-step; }
.kb-step {
    background: var(--wb-card, #fbf8f2);
    border: 1px solid var(--wb-border, #e9e2d5);
    border-radius: var(--wb-radius-sm, 10px);
    padding: 14px;
    position: relative;
}
.kb-step .no {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--wb-accent, #a35a3b);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 8px;
}
.kb-step h4 { margin: 0 0 5px; font-size: 13px; color: var(--wb-text, #33302b); }
.kb-step p { margin: 0; font-size: 11.5px; line-height: 1.7; color: var(--wb-text-2, #6f685e); }
.kb-gd-table-wrap {
    background: var(--wb-card, #fbf8f2);
    border: 1px solid var(--wb-border, #e9e2d5);
    border-radius: var(--wb-radius-sm, 10px);
    overflow: hidden;
}
.kb-gd-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.kb-gd-table th {
    text-align: left;
    padding: 9px 14px;
    background: var(--wb-tile, #f2ece2);
    color: var(--wb-text-2, #6f685e);
    font-weight: 700;
    font-size: 11.5px;
    border-bottom: 1px solid var(--wb-border, #e9e2d5);
}
.kb-gd-table td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--wb-line, #f0ebe1);
    color: var(--wb-text, #33302b);
    vertical-align: top;
}
.kb-gd-table tr:last-child td { border-bottom: none; }
.kb-gd-table td .proto-cnt { font-size: 11px; color: var(--wb-muted, #a89f92); }
.kb-gd-tip {
    background: #f3ece0;
    border: 1px solid #e5dac6;
    border-radius: var(--wb-radius-sm, 10px);
    padding: 12px 16px;
    font-size: 12px;
    line-height: 1.9;
    color: var(--wb-text-2, #6f685e);
}
.kb-gd-tip b { color: var(--wb-accent, #a35a3b); }
.kb-gd-link {
    color: var(--wb-accent, #a35a3b);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.kb-gd-link:hover { color: #96502f; }

/* 窄屏适配 */
@media (max-width: 900px) {
    .kb-detail { display: none; }
    .kb-brands { width: 150px; }
    .kb-gd-stats, .kb-steps { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   浮窗菜单：新增图标的配色
   ============================================================ */
.kb-fab-item-icon.chat { background: #eef3fb; color: #4a7cc9; }
.kb-fab-item-icon.doc  { background: #fdf0e6; color: #b4694a; }

/* 未配置飞书链接时的提示气泡 */
.kb-doc-tip {
    position: absolute;
    right: 0;
    bottom: 66px;
    width: 252px;
    background: #fff;
    border: 1px solid #e6ddcd;
    border-radius: 12px;
    box-shadow: 0 14px 30px rgba(60, 45, 30, .16);
    padding: 12px 14px 10px;
    font-size: 12px;
    line-height: 1.8;
    color: #6f685e;
    z-index: 2;
}
.kb-doc-tip b { display: block; color: #a35a3b; font-size: 12.5px; margin-bottom: 3px; }
.kb-doc-tip code {
    font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px;
    background: #f2ece2; border-radius: 4px; padding: 1px 5px; color: #8a6116;
}
.kb-doc-tip-x {
    margin-top: 8px; font-family: inherit; font-size: 11px; cursor: pointer;
    color: #8a8175; background: #fbf8f2; border: 1px solid #e2d9c8;
    border-radius: 999px; padding: 2px 11px;
}

/* ============================================================
   系统使用教程
   ============================================================ */
.gu {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 26px 34px;
    scroll-behavior: smooth;
}
.gu-inner { max-width: 800px; margin: 0 auto; }

.gu-hero {
    position: relative;
    padding: 18px 20px 17px;
    border-radius: 14px;
    background: linear-gradient(135deg, #fdf6ee 0%, #f6ecdd 55%, #f1e5d2 100%);
    border: 1px solid #ecdfcd;
    overflow: hidden;
}
.gu-hero::after {
    content: '';
    position: absolute; right: -30px; top: -40px; width: 130px; height: 130px;
    border-radius: 50%; background: radial-gradient(circle, rgba(163,90,59,.12), rgba(163,90,59,0) 70%);
}
.gu-hero-badge {
    display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: 1px;
    color: #a35a3b; background: #fff; border: 1px solid #e9d6c7;
    border-radius: 999px; padding: 1px 9px; margin-bottom: 8px;
}
.gu-hero h2 { margin: 0 0 6px; font-size: 18px; color: #33302b; letter-spacing: .5px; }
.gu-hero p { margin: 0; font-size: 12.5px; line-height: 1.9; color: #7a7266; }
.gu-hero p b { color: #a35a3b; }

.gu-toc {
    position: sticky; top: -20px; z-index: 3;
    display: flex; flex-wrap: wrap; gap: 6px;
    margin: 14px 0 20px; padding: 10px 0;
    background: linear-gradient(180deg, #f4efe6 72%, rgba(244,239,230,0));
}
.gu-toc-item {
    font-family: inherit; font-size: 11.5px; cursor: pointer;
    color: #7a7266; background: #fff; border: 1px solid #e6ddcd;
    border-radius: 999px; padding: 3px 11px; transition: all .15s ease;
}
.gu-toc-item:hover { color: #a35a3b; border-color: #dcc2b2; background: #fdf6f2; }

.gu-sec {
    margin-bottom: 26px; padding-bottom: 22px;
    border-bottom: 1px dashed #e3dacb;
    scroll-margin-top: 46px;
}
.gu-sec:last-child { border-bottom: 0; padding-bottom: 4px; }
.gu-head { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; flex-wrap: wrap; }
.gu-num {
    width: 26px; height: 26px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px; color: #fff; font-size: 11.5px; font-weight: 700;
    font-family: Georgia, serif;
    background: linear-gradient(145deg, #b4694a, #96502f);
}
.gu-head h3 { margin: 0; font-size: 15px; color: #33302b; letter-spacing: .3px; }
.gu-tag {
    font-size: 10px; color: #8a7a63; background: #f3ece0;
    border: 1px solid #e6dbc9; border-radius: 999px; padding: 1px 8px;
}
.gu-desc { margin: 0; font-size: 12.5px; line-height: 1.95; color: #6f685e; }
.gu-desc b { color: #a35a3b; }

.gu-steps {
    list-style: none; counter-reset: gu; margin: 12px 0 0; padding: 0;
}
.gu-steps li {
    position: relative; counter-increment: gu;
    padding-left: 23px; margin-bottom: 5px;
    font-size: 12.5px; line-height: 1.95; color: #6f685e;
}
.gu-steps li::before {
    content: counter(gu);
    position: absolute; left: 0; top: 4px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #efe7d9; color: #8a7a63;
    font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.gu-steps li b { color: #33302b; }

.gu-tip {
    margin-top: 12px; padding: 9px 13px;
    border-radius: 9px; background: #f8f4ec;
    border-left: 3px solid #cbb191;
    font-size: 12px; line-height: 1.9; color: #6f685e;
}
.gu-tip b { color: #a35a3b; margin-right: 7px; }

.gu-faqs { display: flex; flex-direction: column; gap: 9px; margin-top: 4px; }
.gu-faq {
    background: #fff; border: 1px solid #ece4d6; border-radius: 10px;
    padding: 9px 13px; font-size: 12.5px; line-height: 1.85; color: #6f685e;
}
.gu-faq b { display: block; color: #33302b; font-size: 12.5px; margin-bottom: 2px; }
.gu-faq code {
    font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px;
    background: #f2ece2; border-radius: 4px; padding: 1px 5px; color: #8a6116;
}
.gu-end {
    margin-top: 14px; text-align: center; font-size: 11.5px; color: #a89f92;
}

/* ---------- 动图演示：公共外框 ---------- */
.gu-demo {
    position: relative;
    height: 206px;
    margin: 13px 0 4px;
    padding: 14px 16px;
    box-sizing: border-box;
    border-radius: 14px;
    border: 1px solid #e6ddcd;
    background: radial-gradient(130% 120% at 12% 0%, #fffdf8 0%, #f7f1e6 55%, #f0e8da 100%);
    overflow: hidden;
}
.gu-demo-cap {
    position: absolute; right: 12px; bottom: 8px;
    font-size: 10px; color: #b6ab98; letter-spacing: .3px;
}
.gu-demo svg { display: block; }

/* 通用「点这里」光圈 */
.d2-ring {
    position: absolute; inset: -5px;
    border-radius: 9px;
    border: 1.5px solid rgba(163, 90, 59, .55);
    opacity: 0;
    pointer-events: none;
    animation: d2ring 6s infinite;
}
@keyframes d2ring {
    0%, 8%   { opacity: 0; transform: scale(.94); }
    13%      { opacity: 1; transform: scale(1); }
    24%      { opacity: 0; transform: scale(1.14); }
    100%     { opacity: 0; transform: scale(1.14); }
}

/* ---------- D1 概览 ---------- */
.d1-top { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: #3a352e; }
.d1-live {
    width: 7px; height: 7px; border-radius: 50%; background: #71895a;
    animation: d1pulse 2.3s infinite;
}
@keyframes d1pulse {
    0%   { box-shadow: 0 0 0 0 rgba(113, 137, 90, .5); }
    70%  { box-shadow: 0 0 0 7px rgba(113, 137, 90, 0); }
    100% { box-shadow: 0 0 0 0 rgba(113, 137, 90, 0); }
}
.d1-date { font-weight: 400; font-size: 10.5px; color: #a89f92; margin-left: 2px; }
.d1-refresh {
    margin-left: auto; font-size: 10px; font-weight: 500;
    border: 1px solid #e0d6c4; background: #fff; border-radius: 999px;
    padding: 2px 10px; color: #7d7466;
    animation: d1btn 6s infinite;
}
@keyframes d1btn {
    0%, 62% { background: #fff; border-color: #e0d6c4; color: #7d7466; }
    70%, 80% { background: #f6ecdd; border-color: #d9bfa8; color: #a35a3b; }
    90%, 100% { background: #fff; border-color: #e0d6c4; color: #7d7466; }
}
.d1-sum {
    display: flex; align-items: center; gap: 10px;
    margin-top: 10px; padding: 7px 11px; border-radius: 9px; background: #f5f0e5;
}
.d1-sum-txt { font-size: 11.5px; color: #6f685e; white-space: nowrap; }
.d1-sum-txt b { font-family: Georgia, serif; font-size: 15px; color: #33302b; }
.d1-bar { flex: 1; height: 7px; border-radius: 4px; background: #e4ddcd; overflow: hidden; }
.d1-bar i {
    display: block; height: 100%; border-radius: 4px; width: 0;
    background: linear-gradient(90deg, #9dbb7c, #6d8a4f);
    animation: d1fill 6s ease-out infinite;
}
@keyframes d1fill {
    0%   { width: 0; }
    24%  { width: 72%; }
    94%  { width: 72%; }
    100% { width: 0; }
}
.d1-rate { font-family: Georgia, serif; font-size: 13px; font-weight: 700; color: #5a7a3a; }
.d1-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 11px; }
.d1-card {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid #ece4d6; border-radius: 10px;
    padding: 7px 9px; min-width: 0;
    opacity: 0; animation: d1in 6s infinite;
}
.d1-card:nth-child(2) { animation-delay: .18s; }
.d1-card:nth-child(3) { animation-delay: .36s; }
@keyframes d1in {
    0%   { opacity: 0; transform: translateY(7px); }
    12%  { opacity: 1; transform: none; }
    92%  { opacity: 1; }
    100% { opacity: 0; }
}
.d1-ring { width: 34px; height: 34px; flex-shrink: 0; transform: rotate(-90deg); }
.d1-ring circle { fill: none; stroke-width: 3.6; }
.d1-ring .bg { stroke: #eee6d7; }
.d1-ring .fg {
    stroke: #71895a; stroke-linecap: round;
    stroke-dasharray: 94.2; stroke-dashoffset: 94.2;
    animation: d1ring 6s ease-out infinite;
}
@keyframes d1ring {
    0%   { stroke-dashoffset: 94.2; }
    26%  { stroke-dashoffset: calc(94.2 - 94.2 * var(--pct) / 100); }
    94%  { stroke-dashoffset: calc(94.2 - 94.2 * var(--pct) / 100); }
    100% { stroke-dashoffset: 94.2; }
}
.d1-cm { min-width: 0; }
.d1-cm b { font-size: 11.5px; color: #33302b; }
.d1-cm small { display: block; font-size: 9.5px; color: #a89f92; margin-top: 1px; white-space: nowrap; }

/* ---------- D2 改状态 ---------- */
.d2-card {
    background: #fff; border: 1px solid #ece4d6; border-radius: 12px;
    padding: 11px 13px;
}
.d2-head { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: #33302b; }
.d2-head b { font-size: 13px; }
.d2-code {
    font-size: 9.5px; background: #f2ece2; color: #8a8175;
    border-radius: 4px; padding: 1px 5px;
}
.d2-time { margin-left: auto; font-size: 10.5px; color: #a89f92; }
.d2-meta { margin-top: 5px; font-size: 10.5px; color: #a89f92; }
.d2-chips { position: relative; height: 21px; margin-top: 8px; }
.d2-chip {
    position: absolute; left: 0; top: 0;
    font-size: 10.5px; border-radius: 999px; padding: 1px 10px; line-height: 1.7;
}
.d2-old { background: #f2ece2; color: #8a8175; animation: d2old 6s infinite; }
.d2-new { background: #eaf2df; color: #4d6b31; animation: d2new 6s infinite; }
@keyframes d2old {
    0%, 26%   { opacity: 1; }
    34%, 100% { opacity: 0; }
}
@keyframes d2new {
    0%, 26% { opacity: 0; transform: scale(.9); }
    36%, 96% { opacity: 1; transform: none; }
    100%    { opacity: 0; }
}
.d2-tools { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.d2-tool {
    position: relative;
    font-size: 10.5px; padding: 3px 10px; border-radius: 7px;
    border: 1px solid #e6ddcd; background: #fdfbf7; color: #7d7466;
}
.d2-hi { border-color: #c7d6b4; background: #f3f8ec; color: #4d6b31; font-weight: 600; }
.d2-toast {
    position: absolute; left: 50%; bottom: 26px;
    transform: translate(-50%, 8px);
    background: #2e2c28; color: #fff; font-size: 11px;
    padding: 6px 12px; border-radius: 8px; white-space: nowrap;
    opacity: 0; animation: d2toast 6s infinite;
}
@keyframes d2toast {
    0%, 38%  { opacity: 0; transform: translate(-50%, 8px); }
    45%, 74% { opacity: 1; transform: translate(-50%, 0); }
    83%,100% { opacity: 0; transform: translate(-50%, 8px); }
}

/* ---------- D3 添加任务 ---------- */
.d3-bg {
    position: absolute; inset: 14px; border-radius: 10px;
    background: #fff; border: 1px solid #f0e8da; padding: 12px; opacity: .5;
}
.d3-line { height: 9px; border-radius: 5px; background: #f1ebdf; margin-bottom: 8px; }
.d3-line.short { width: 52%; }
.d3-btn {
    position: absolute; right: 22px; top: 18px;
    font-size: 10.5px; font-weight: 600; color: #fff;
    background: #2e2c28; border-radius: 8px; padding: 5px 11px;
}
.d3-modal {
    position: absolute; left: 50%; top: 50%;
    width: min(316px, 84%);
    background: #fff; border: 1px solid #e6ddcd; border-radius: 12px;
    box-shadow: 0 12px 26px rgba(60, 45, 30, .16);
    padding: 12px 14px 13px;
    opacity: 0;
    animation: d3modal 6s infinite;
}
@keyframes d3modal {
    0%, 9%   { opacity: 0; transform: translate(-50%, -46%) scale(.94); }
    17%, 84% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    92%,100% { opacity: 0; transform: translate(-50%, -50%) scale(.98); }
}
.d3-mtitle { font-size: 12.5px; font-weight: 700; color: #33302b; margin-bottom: 9px; }
.d3-f { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 11px; }
.d3-f i { font-style: normal; color: #a89f92; width: 50px; flex-shrink: 0; }
.d3-type {
    display: inline-block; overflow: hidden; white-space: nowrap;
    vertical-align: bottom; color: #33302b; width: 0;
    border-bottom: 1px solid #ece4d6; padding-bottom: 1px;
    animation: d3type 6s steps(16, end) infinite;
}
.d3-type.t1 { --w: 8.2em; animation-delay: .25s; }
.d3-type.t2 { --w: 2.2em; animation-delay: 1.05s; }
.d3-type.t3 { --w: 6.6em; animation-delay: 1.65s; }
@keyframes d3type {
    0%, 8%   { width: 0; border-color: #c9b18d; }
    26%      { width: var(--w); border-color: #c9b18d; }
    92%      { width: var(--w); border-color: #ece4d6; }
    100%     { width: 0; }
}
.d3-mat {
    font-style: normal; font-size: 9px; color: #4d6b31;
    background: #eef4e5; border-radius: 999px; padding: 1px 6px;
    opacity: 0; animation: d3mat 6s infinite;
}
@keyframes d3mat { 0%, 26% { opacity: 0; } 32%, 92% { opacity: 1; } 100% { opacity: 0; } }
.d3-save {
    position: relative; margin-top: 3px; text-align: center;
    font-size: 11px; font-weight: 600; color: #fff;
    background: #a35a3b; border-radius: 8px; padding: 6px;
}
.d3-save .d2-ring { inset: -4px; border-radius: 10px; animation-delay: 3.6s; }

/* ---------- D9 复制信息 ---------- */
.d9-panel {
    position: absolute; left: 16px; right: 16px; top: 16px;
    background: #fff; border: 1px solid #ece4d6; border-radius: 11px;
    padding: 11px 13px;
}
.d9-head {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 11.5px; font-weight: 700; color: #33302b;
}
.d9-head span { font-weight: 400; font-size: 10px; color: #a89f92; }
.d9-row {
    display: flex; align-items: center; gap: 8px;
    margin-top: 7px; padding: 5px 8px;
    border: 1px solid #f0e8da; border-radius: 8px; background: #fdfbf7;
}
.d9-row.r1 { animation: d9row 6s infinite .3s; }
.d9-row.r2 { animation: d9row 6s infinite 1.5s; }
@keyframes d9row {
    0%, 8%   { background: #fdfbf7; border-color: #f0e8da; transform: none; }
    15%, 26% { background: #f3f8ec; border-color: #bfd3a8; transform: translateX(3px); }
    40%,100% { background: #fdfbf7; border-color: #f0e8da; transform: none; }
}
.d9-k { font-size: 10px; color: #a89f92; width: 32px; flex-shrink: 0; }
.d9-row code {
    font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px;
    color: #45632f; background: #f3f7ee; border: 1px solid #d9e3d0;
    border-radius: 6px; padding: 2px 7px;
}
.d9-cp {
    margin-left: auto; font-style: normal; font-size: 9.5px;
    color: #a35a3b; border: 1px solid #e7d6cb; border-radius: 999px;
    padding: 1px 8px; background: #fdf6f2;
}
.d9-hint { margin-top: 8px; font-size: 10px; color: #b6ab98; }
.d9-toast {
    position: absolute; left: 50%; bottom: 30px; transform: translate(-50%, 8px);
    background: #2e2c28; color: #fff; font-size: 11px;
    padding: 6px 13px; border-radius: 8px; white-space: nowrap;
    opacity: 0; animation: d9toast 6s infinite;
}
@keyframes d9toast {
    0%, 30%  { opacity: 0; transform: translate(-50%, 8px); }
    37%, 68% { opacity: 1; transform: translate(-50%, 0); }
    78%,100% { opacity: 0; transform: translate(-50%, 8px); }
}

/* ---------- D5 医院搜索 ---------- */
.d5-box {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid #e6ddcd; border-radius: 10px;
    padding: 7px 10px;
}
.d5-box svg { width: 13px; height: 13px; color: #a89f92; flex-shrink: 0; }
.d5-type {
    font-size: 11.5px; color: #33302b; white-space: nowrap; overflow: hidden;
    width: 0; border-right: 1px solid #c9b18d;
    animation: d5type 6s steps(8, end) infinite;
}
@keyframes d5type {
    0%, 6%   { width: 0; border-color: #c9b18d; }
    20%      { width: 3.1em; border-color: #c9b18d; }
    70%      { width: 3.1em; border-color: transparent; }
    100%     { width: 0; border-color: transparent; }
}
.d5-go {
    margin-left: auto; font-family: inherit; font-size: 10px;
    border: none; background: #2e2c28; color: #fff;
    border-radius: 7px; padding: 3px 10px; cursor: default;
}
.d5-rows { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.d5-row {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid #ece4d6; border-radius: 9px;
    padding: 7px 10px; font-size: 11px; color: #6f685e;
    opacity: 0; animation: d5row 6s infinite;
}
.d5-row.r1 { animation-delay: .55s; }
.d5-row.r2 { animation-delay: .85s; }
.d5-row.r3 { animation-delay: 1.15s; }
@keyframes d5row {
    0%   { opacity: 0; transform: translateY(6px); }
    14%  { opacity: 1; transform: none; }
    88%  { opacity: 1; }
    100% { opacity: 0; }
}
.d5-row b { color: #33302b; font-size: 11.5px; font-weight: 600; }
.d5-sub { color: #a89f92; font-size: 10px; margin-left: auto; white-space: nowrap; }
.d5-act {
    position: relative; font-size: 10px; color: #3a6fb0;
    border: 1px solid #cddcef; background: #f4f8fd; border-radius: 999px;
    padding: 1px 8px; white-space: nowrap;
}
.d5-act .d2-ring { inset: -3px; animation-delay: 2.1s; border-color: rgba(58, 111, 176, .5); }

/* ---------- D10 表格 ---------- */
.d10-head {
    display: flex; gap: 10px; font-size: 9.5px; color: #a89f92;
    padding: 0 10px 6px; border-bottom: 1px solid #ece4d6;
}
.d10-head > span { flex: 1; }
.d10-add { flex: 0 0 auto !important; background: #2e2c28; color: #fff; border-radius: 6px; padding: 1px 8px; }
.d10-row {
    display: flex; gap: 10px; align-items: center;
    font-size: 10.5px; color: #6f685e;
    background: #fff; border: 1px solid #ece4d6; border-radius: 9px;
    padding: 7px 10px; margin-top: 7px;
    opacity: 0; animation: d5row 6s infinite;
}
.d10-row > span, .d10-row > b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d10-row.r1 { animation-delay: .4s; }
.d10-row.r2 { animation-delay: .8s; }
.d10-row.r3 { animation-delay: 1.2s; }
.d10-row b { color: #33302b; font-size: 11px; font-weight: 600; }
.d10-tag {
    flex: 0 0 auto !important; font-size: 9.5px; background: #eaf2df; color: #4d6b31;
    border-radius: 999px; padding: 1px 8px;
}
.d10-tag.is-blue { background: #eef3fb; color: #3a6fb0; }
.d10-tag.is-red  { background: #fbece8; color: #a83a2a; }

/* ---------- D4 上传资料 ---------- */
.d4-left {
    position: absolute; left: 16px; top: 16px; width: 43%; height: 152px;
    border: 1.5px dashed #dccfb9; border-radius: 12px;
    background: #fffdf8; display: flex; align-items: center; justify-content: center;
    text-align: center;
}
.d4-drop { font-size: 11px; color: #a89f92; line-height: 1.9; }
.d4-drop span { font-size: 9.5px; color: #c0b5a2; }
.d4-file {
    position: absolute; left: 32px; top: 84px;
    display: flex; align-items: center; gap: 6px;
    background: #fff; border: 1px solid #e6ddcd; border-radius: 8px;
    padding: 6px 9px; font-size: 10.5px; color: #33302b;
    box-shadow: 0 6px 14px rgba(80, 60, 40, .1);
    opacity: 0; animation: d4move 6s infinite;
}
.d4-file svg { width: 12px; height: 12px; color: #a35a3b; }
@keyframes d4move {
    0%   { opacity: 0; transform: translate(0, 6px); }
    10%  { opacity: 1; transform: translate(0, 0); }
    34%  { opacity: 1; transform: translate(72%, -18px) scale(.96); }
    44%,100% { opacity: 0; transform: translate(72%, -18px) scale(.92); }
}
.d4-right { position: absolute; right: 16px; top: 22px; width: 40%; text-align: center; }
.d4-folder {
    position: relative; display: inline-block; font-size: 10.5px; color: #7d6a54;
    background: #f5efe3; border: 1px solid #e6dbc9; border-radius: 9px; padding: 6px 11px;
}
.d4-folder .d2-ring { animation-delay: 1.9s; border-color: rgba(113, 137, 90, .6); }
.d4-bar { margin-top: 13px; height: 6px; border-radius: 4px; background: #e8e0d1; overflow: hidden; }
.d4-bar i {
    display: block; height: 100%; width: 0; border-radius: 4px;
    background: linear-gradient(90deg, #9dbb7c, #6d8a4f);
    animation: d4bar 6s ease-out infinite;
}
@keyframes d4bar {
    0%, 20% { width: 0; }
    40%     { width: 100%; }
    94%     { width: 100%; }
    100%    { width: 0; }
}
.d4-ok {
    margin-top: 11px; font-size: 10px; color: #4d6b31;
    opacity: 0; animation: d4ok 6s infinite;
}
@keyframes d4ok {
    0%, 42%  { opacity: 0; transform: translateY(4px); }
    50%, 90% { opacity: 1; transform: none; }
    100%     { opacity: 0; }
}

/* ---------- D6 知识库图谱 ---------- */
.d6 svg { position: absolute; left: 12px; top: 8px; width: calc(100% - 24px); height: calc(100% - 26px); }
.d6 .d6-edge {
    fill: none; stroke: #ddd4c4; stroke-width: 1.6;
    stroke-dasharray: 220; stroke-dashoffset: 220;
    animation: d6edge 6s ease-out infinite;
}
.d6 .d6-edge.e2 { animation-delay: .12s; }
.d6 .d6-edge.e3 { animation-delay: .24s; }
.d6 .d6-edge.e4 { animation-delay: .3s; }
.d6 .d6-edge.e5 { animation-delay: .36s; }
.d6 .d6-edge.e6 { animation-delay: .48s; }
@keyframes d6edge {
    0%   { stroke-dashoffset: 220; stroke: #e2dacb; }
    26%  { stroke-dashoffset: 0; stroke: #c9b18d; }
    92%  { stroke-dashoffset: 0; stroke: #c9b18d; }
    100% { stroke-dashoffset: 220; stroke: #e2dacb; }
}
.d6 .d6-n { opacity: 0; animation: d6node 6s infinite; transform-box: fill-box; transform-origin: center; }
.d6 .d6-n.n0 { animation-delay: .1s; }
.d6 .d6-n.n1 { animation-delay: .28s; }
.d6 .d6-n.n2 { animation-delay: .36s; }
.d6 .d6-n.n3 { animation-delay: .5s; }
.d6 .d6-n.n4 { animation-delay: .56s; }
.d6 .d6-n.n5 { animation-delay: .62s; }
.d6 .d6-n.n6 { animation-delay: .78s; }
@keyframes d6node {
    0%   { opacity: 0; transform: scale(.82); }
    12%  { opacity: 1; transform: scale(1); }
    90%  { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(.9); }
}
.d6 .d6-n rect { stroke-width: 1; }
.d6 .d6-n text {
    font-size: 11px; font-weight: 600; fill: #fff;
    text-anchor: middle; font-family: inherit;
}
.d6 .d6-n.n0 rect { fill: #a35a3b; stroke: #7e4227; }
.d6 .d6-n.n1 rect, .d6 .d6-n.n2 rect { fill: #5f7d9c; stroke: #44607d; }
.d6 .d6-n.n3 rect, .d6 .d6-n.n4 rect { fill: #8f6fae; stroke: #6f538d; }
.d6 .d6-n.n5 rect { fill: #71895a; stroke: #556b41; }
.d6 .d6-n.n6 rect { fill: #eef3fb; stroke: #b9cbe6; }
.d6 .d6-n.n6 text { fill: #3a6fb0; }

/* ---------- D7 聊天室 ---------- */
.d7 { display: flex; flex-direction: column; }
.d7-msgs { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 7px; overflow: hidden; }
.d7-m { max-width: 78%; opacity: 0; animation: d7m 6s infinite; }
.d7-m.m1 { animation-delay: .15s; }
.d7-m.m2 { animation-delay: .9s; }
.d7-m.m3 { animation-delay: 1.7s; }
.d7-m.m4 { animation-delay: 3.2s; }
@keyframes d7m {
    0%   { opacity: 0; transform: translateY(7px); }
    9%   { opacity: 1; transform: none; }
    90%  { opacity: 1; }
    100% { opacity: 0; }
}
.d7-m b { display: block; font-size: 9.5px; font-weight: 500; color: #b0a693; margin-bottom: 2px; }
.d7-m > span {
    display: inline-block; font-size: 10.5px; line-height: 1.65;
    padding: 5px 10px; border-radius: 10px;
    background: #fff; border: 1px solid #ece4d6; color: #3f3a33;
}
.d7-m.me { align-self: flex-end; text-align: right; }
.d7-m.me > span { background: #eef4e5; border-color: #d7e3c7; color: #41522f; }
.d7-att { display: inline-flex; align-items: center; gap: 6px; }
.d7-att i {
    width: 11px; height: 13px; border: 1.4px solid #b9ac95;
    border-radius: 3px; display: inline-block;
}
.d7-bar {
    display: flex; align-items: center; gap: 8px; margin: 9px 14px 14px 0;
    padding: 6px 9px; background: #fff; border: 1px solid #e6ddcd; border-radius: 10px;
}
.d7-input { flex: 1; font-size: 10.5px; color: #b3a998; }
.d7-send {
    position: relative; font-size: 10px; color: #fff;
    background: #a35a3b; border-radius: 7px; padding: 3px 10px;
}
.d7-send .d2-ring { inset: -4px; animation-delay: 2.7s; }

/* ---------- D8 飞书文档 ---------- */
.d8-menu {
    position: absolute; right: 16px; bottom: 18px; width: 148px;
    display: flex; flex-direction: column; gap: 5px;
}
.d8-item {
    font-size: 9.5px; color: #6f685e; background: #fff;
    border: 1px solid #e6ddcd; border-radius: 7px; padding: 5px 9px;
    opacity: 0; animation: d8item 6s infinite;
}
.d8-item:nth-child(1) { animation-delay: .08s; }
.d8-item:nth-child(2) { animation-delay: .16s; }
.d8-item:nth-child(3) { animation-delay: .24s; }
@keyframes d8item {
    0%   { opacity: 0; transform: translateX(6px); }
    10%  { opacity: 1; transform: none; }
    92%  { opacity: 1; }
    100% { opacity: 0; }
}
.d8-hi {
    position: relative; font-weight: 600; color: #a35a3b;
    border-color: #e7cfc2; background: #fdf6f2;
}
.d8-hi .d2-ring { inset: -4px; border-radius: 8px; animation-delay: 1.5s; }
.d8-tab {
    position: absolute; left: 16px; top: 16px; width: calc(100% - 200px); height: 152px;
    background: #fff; border: 1px solid #e6ddcd; border-radius: 11px;
    padding: 10px 12px; box-sizing: border-box;
    opacity: 0; animation: d8tab 6s infinite;
}
@keyframes d8tab {
    0%, 30%  { opacity: 0; transform: translateY(10px); }
    40%, 92% { opacity: 1; transform: none; }
    100%     { opacity: 0; transform: translateY(6px); }
}
.d8-bar { display: flex; gap: 4px; margin-bottom: 9px; }
.d8-bar i { width: 6px; height: 6px; border-radius: 50%; background: #e6dfd1; }
.d8-tab b { font-size: 11.5px; color: #33302b; }
.d8-tabsub { display: block; font-size: 9.5px; color: #a89f92; margin-top: 2px; }
.d8-lines { display: block; margin-top: 12px; }
.d8-lines i { display: block; height: 6px; border-radius: 4px; background: #f2ece2; margin-bottom: 6px; }
.d8-lines i:nth-child(2) { width: 84%; }
.d8-lines i:nth-child(3) { width: 62%; }

/* ============================================================
   安装脚本视图（悬浮球入口，内嵌 安装脚本/index.html）
   —— 纯净版：不带授权码 / 密钥，进去自己填
   ============================================================ */
.kb-body.is-script { padding: 0; background: var(--wb-bg, #f4efe6); }
.kb-script {
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--wb-bg, #f4efe6);
}
.kb-script-frame {
    flex: 1;
    min-height: 0;
    width: 100%;
    border: 0;
    display: block;
    background: var(--wb-bg, #f4efe6);
}
.kb-script-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: 13px;
    color: var(--wb-muted, #a89f92);
    background: var(--wb-bg, #f4efe6);
    transition: opacity .2s ease;
    z-index: 2;
}
.kb-script-loading.is-hide { opacity: 0; pointer-events: none; }

/* ============================================================
   公开聊天室
   ============================================================ */
.kb-body.is-chat { padding: 0; }
.ch { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }

/* 名字门 */
.ch-gate {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center;
    padding: 40px 30px;
}
.ch-gate-ic {
    width: 54px; height: 54px; border-radius: 16px;
    background: #f3e6dd; color: #a35a3b;
    display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.ch-gate-ic svg { width: 26px; height: 26px; }
.ch-gate h3 { margin: 0 0 6px; font-size: 16px; color: #33302b; }
.ch-gate p { margin: 0; max-width: 350px; font-size: 12.5px; line-height: 1.95; color: #8a8175; }
.ch-gate p b { color: #a35a3b; }
.ch-gate-row { display: flex; gap: 8px; margin-top: 16px; }
.ch-gate-input {
    width: 190px; height: 34px; box-sizing: border-box;
    font-family: inherit; font-size: 12.5px; color: #33302b;
    background: #fff; border: 1px solid #e2d9c8; border-radius: 9px; padding: 0 11px; outline: none;
}
.ch-gate-input:focus { border-color: #c0896d; box-shadow: 0 0 0 3px rgba(163, 90, 59, .08); }
.ch-gate-ok {
    height: 34px; padding: 0 15px; border: none; border-radius: 9px;
    background: linear-gradient(145deg, #b4694a, #96502f); color: #fff;
    font-family: inherit; font-size: 12.5px; cursor: pointer;
}
.ch-gate-ok:hover { filter: brightness(1.05); }
.ch-gate-tip { margin-top: 9px; font-size: 10.5px; color: #b6ab98; }

/* 顶部条 */
.ch-head {
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 9px 16px;
    background: #fbf8f2; border-bottom: 1px solid #e8e0d2;
    font-size: 11.5px; color: #6f685e;
}
.ch-online { display: inline-flex; align-items: center; gap: 6px; }
.ch-online i { width: 7px; height: 7px; border-radius: 50%; background: #71895a; animation: d1pulse 2.4s infinite; }
.ch-online b { font-family: Georgia, serif; font-size: 13px; color: #33302b; }
.ch-me b { color: #a35a3b; }
.ch-rename, .ch-name-ok {
    margin-left: 6px; font-family: inherit; font-size: 10.5px; cursor: pointer;
    color: #8a8175; background: #fff; border: 1px solid #e2d9c8;
    border-radius: 999px; padding: 1px 9px;
}
.ch-rename:hover, .ch-name-ok:hover { color: #a35a3b; border-color: #dcc2b2; }
.ch-name-input {
    width: 110px; font-family: inherit; font-size: 11.5px; color: #33302b;
    background: #fff; border: 1px solid #e2d9c8; border-radius: 7px;
    padding: 2px 8px; outline: none;
}

/* 消息区 */
.ch-list {
    flex: 1; min-height: 0; overflow-y: auto;
    padding: 14px 16px 10px;
    background: linear-gradient(180deg, #f8f3ea, #f4efe6 45%);
    display: flex; flex-direction: column; gap: 10px;
}
.ch-loading { font-size: 12px; color: #a89f92; text-align: center; padding: 30px 0; }
.ch-empty {
    margin: auto; text-align: center; font-size: 12px; color: #b0a693;
    padding: 30px 10px; line-height: 1.9;
}
.ch-empty.is-err { color: #a83a2a; }
.ch-day {
    align-self: center; font-size: 10px; color: #a89f92;
    background: #efe9dd; border-radius: 999px; padding: 1px 10px; margin: 2px 0;
}
.ch-more {
    align-self: center; font-family: inherit; font-size: 10.5px; cursor: pointer;
    color: #8a8175; background: #fff; border: 1px solid #e2d9c8;
    border-radius: 999px; padding: 3px 12px; margin-bottom: 4px;
}
.ch-more:hover { color: #a35a3b; border-color: #dcc2b2; }

.ch-msg { display: flex; gap: 8px; align-items: flex-start; }
.ch-msg.is-mine { flex-direction: row-reverse; }
.ch-msg.is-cont { margin-top: -6px; }
.ch-msg.is-cont .ch-face { visibility: hidden; }
.ch-face {
    width: 26px; height: 26px; flex-shrink: 0;
    border-radius: 8px; background: #e9e0d1; color: #8a7a63;
    font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.ch-face.mine { background: #e0e9d3; color: #5a7a3a; }
.ch-body { min-width: 0; max-width: calc(100% - 46px); display: flex; flex-direction: column; }
.ch-msg.is-mine .ch-body { align-items: flex-end; }
.ch-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; font-size: 10px; color: #a89f92; }
.ch-meta b { font-size: 10.5px; font-weight: 600; color: #8a8175; }
.ch-bubble {
    display: inline-block; max-width: 100%;
    font-size: 12.5px; line-height: 1.75; color: #3f3a33;
    background: #fff; border: 1px solid #ece4d6; border-radius: 10px;
    padding: 6px 11px;
    white-space: pre-wrap; word-break: break-word;
}
.ch-msg.is-mine .ch-bubble { background: #eef4e5; border-color: #d7e3c7; color: #37472a; }
.ch-bubble a { color: #3a6fb0; text-decoration: underline; text-underline-offset: 2px; }
.ch-bubble.is-file { display: flex; align-items: center; gap: 8px; padding: 7px 9px; }
.ch-att-main { display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; min-width: 0; }
.ch-att-main:hover .ch-att-name { color: #a35a3b; }
.ch-att-ic { width: 26px; height: 26px; flex-shrink: 0; color: #a35a3b; }
.ch-att-ic svg { width: 26px; height: 26px; }
.ch-att-name {
    font-size: 12px; color: #33302b; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px;
}
.ch-att-name small { display: block; font-weight: 400; font-size: 10px; color: #a89f92; }
.ch-att-dl {
    width: 26px; height: 26px; flex-shrink: 0; border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    color: #7d7466; background: #f6f1e7; border: 1px solid #ece4d6;
    text-decoration: none;
}
.ch-att-dl:hover { color: #a35a3b; border-color: #dcc2b2; }
.ch-att-dl svg { width: 13px; height: 13px; }
.ch-img { display: block; line-height: 0; }
.ch-img img {
    max-width: 200px; max-height: 160px; border-radius: 8px;
    border: 1px solid #ece4d6; object-fit: cover;
}
.ch-note { margin-top: 4px; font-size: 11.5px; color: #8a8175; }

/* 输入区 */
.ch-composer {
    position: relative; flex-shrink: 0;
    display: flex; align-items: flex-end; gap: 8px;
    padding: 10px 86px 10px 12px; /* 右侧留白：避免被右下角浮窗球挡住发送按钮 */
    background: #fbf8f2; border-top: 1px solid #e8e0d2;
}
.ch-clip {
    width: 34px; height: 34px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid #e2d9c8; border-radius: 9px; background: #fff;
    color: #7d7466; cursor: pointer;
}
.ch-clip:hover { color: #a35a3b; border-color: #e0c9b8; }
.ch-clip svg { width: 16px; height: 16px; }
.ch-text {
    flex: 1; min-height: 34px; max-height: 108px; box-sizing: border-box;
    resize: none; overflow-y: auto;
    font-family: inherit; font-size: 12.5px; line-height: 1.6; color: #33302b;
    background: #fff; border: 1px solid #e2d9c8; border-radius: 9px;
    padding: 7px 10px; outline: none;
}
.ch-text:focus { border-color: #c0896d; box-shadow: 0 0 0 3px rgba(163, 90, 59, .08); }
.ch-send {
    display: flex; align-items: center; gap: 4px; flex-shrink: 0;
    height: 34px; padding: 0 13px; border: none; border-radius: 9px;
    background: linear-gradient(145deg, #b4694a, #96502f); color: #fff;
    font-family: inherit; font-size: 12px; cursor: pointer;
}
.ch-send:hover { filter: brightness(1.06); }
.ch-send:disabled { opacity: .55; cursor: not-allowed; }
.ch-send svg { width: 14px; height: 14px; }
.ch-drop {
    position: absolute; inset: 6px; z-index: 2;
    display: none; flex-direction: column; align-items: center; justify-content: center;
    border: 1.5px dashed #c0896d; border-radius: 10px;
    background: rgba(253, 246, 242, .95);
    color: #a35a3b; pointer-events: none;
}
.ch-drop.is-on { display: flex; }
.ch-drop b { font-size: 12.5px; }
.ch-drop span { font-size: 10.5px; color: #a89f92; margin-top: 3px; }
.ch-toast {
    position: absolute; left: 50%; bottom: 58px;
    transform: translate(-50%, 6px);
    max-width: 82%; text-align: center;
    background: rgba(46, 44, 40, .94); color: #fff;
    font-size: 11.5px; line-height: 1.7; padding: 6px 13px; border-radius: 8px;
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}
.ch-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.ch-toast.is-error { background: rgba(150, 55, 45, .95); }

/* 窄屏 */
@media (max-width: 720px) {
    .gu { padding: 16px 14px 28px; }
    .gu-demo { height: 190px; padding: 12px; }
    .d1-cards { gap: 6px; }
    .d1-cm small { display: none; }
    .ch-att-name { max-width: 130px; }
    .ch-img img { max-width: 150px; }
}

/* ============================================================
   绑定飞书通知（浮窗视图 .fb）
   —— 左侧二维码 + 右侧教程 / 绑定状态自查
   ============================================================ */
.fb {
    position: relative;
    padding: 18px 20px 30px;
    height: 100%;
    overflow-y: auto;
}
.fb-loading {
    padding: 60px 0;
    text-align: center;
    font-size: 13px;
    color: var(--wb-muted, #a89f92);
}
.fb-loading.is-bad { color: #b4493c; }

.fb-hero {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, #fdf8f1 0%, #f7ecdf 100%);
    border: 1px solid var(--wb-border, #e9e2d5);
}
.fb-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 999px;
    background: #f1e0d2;
    color: #8d4b2c;
    letter-spacing: .2px;
}
.fb-hero-txt h2 {
    margin: 7px 0 5px;
    font-size: 19px;
    font-weight: 800;
    color: var(--wb-text, #33302b);
    letter-spacing: .3px;
}
.fb-hero-txt p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.85;
    color: var(--wb-text-2, #6f685e);
}
.fb-hero-state {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 11px;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}
.fb-hero-state.on  { background: #eaf2e4; color: #4d6b3a; border-color: #cfe0c1; }
.fb-hero-state.off { background: #f6f2ea; color: #8a8071; border-color: #e4ddcf; }

.fb-grid {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 16px;
    margin-top: 14px;
    align-items: start;
}

/* ---------- 二维码 ---------- */
.fb-side {
    background: var(--wb-card, #fbf8f2);
    border: 1px solid var(--wb-border, #e9e2d5);
    border-radius: 14px;
    padding: 14px;
    text-align: center;
}
.fb-qr-frame {
    position: relative;
    padding: 9px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--wb-border, #e9e2d5);
    box-shadow: inset 0 0 0 4px #fff;
}
.fb-qr {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
    background: #fff;
    image-rendering: pixelated;
}
.fb-qr-corner {
    position: absolute;
    width: 13px;
    height: 13px;
    border: 2px solid var(--wb-accent, #a35a3b);
    border-radius: 2px;
    opacity: .8;
}
.fb-qr-corner.tl { left: -1px; top: -1px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.fb-qr-corner.tr { right: -1px; top: -1px; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
.fb-qr-corner.bl { left: -1px; bottom: -1px; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
.fb-qr-corner.br { right: -1px; bottom: -1px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }

.fb-qr-tip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
    font-size: 11.5px;
    line-height: 1.7;
    color: var(--wb-muted, #a89f92);
}
.fb-qr-tip svg { width: 14px; height: 14px; flex-shrink: 0; }

.fb-side-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

/* ---------- 通用按钮 ---------- */
.fb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 9px;
    border: 1px solid var(--wb-accent, #a35a3b);
    background: var(--wb-accent, #a35a3b);
    color: #fff;
    cursor: pointer;
    transition: filter .15s ease, transform .15s ease, border-color .15s ease;
    white-space: nowrap;
}
.fb-btn svg { width: 13px; height: 13px; }
.fb-btn:hover { filter: brightness(1.06); }
.fb-btn:active { transform: translateY(1px); }
.fb-btn.ghost {
    background: #fff;
    color: var(--wb-text-2, #6f685e);
    border-color: var(--wb-border, #e9e2d5);
    font-weight: 500;
}
.fb-btn.ghost:hover { border-color: var(--wb-accent-soft, #c0896d); color: var(--wb-accent, #a35a3b); }

/* ---------- 右侧：步骤 / 提示 / 自查 ---------- */
.fb-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fb-sec-h {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--wb-text, #33302b);
    margin-bottom: 9px;
}
.fb-sec-h span {
    font-size: 11.5px;
    font-weight: 400;
    color: var(--wb-muted, #a89f92);
}
.fb-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.fb-steps li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--wb-card, #fbf8f2);
    border: 1px solid var(--wb-border, #e9e2d5);
    border-radius: 12px;
}
.fb-num {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 1px;
    border-radius: 50%;
    background: var(--wb-accent, #a35a3b);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fb-step-txt {
    font-size: 12.5px;
    line-height: 1.9;
    color: var(--wb-text-2, #6f685e);
    word-break: break-word;
}
.fb-cmd {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 12px;
    background: #f6ece0;
    border: 1px dashed #cba487;
    color: #8d4b2c;
    padding: 1px 7px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s ease;
    white-space: nowrap;
}
.fb-cmd:hover { background: #efdcc9; }
.fb-cmd:active { transform: translateY(1px); }

.fb-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 11px 13px;
    border-radius: 11px;
    background: #f3f5ec;
    border: 1px solid #dfe6d3;
    font-size: 12px;
    line-height: 1.85;
    color: #57663f;
}
.fb-note svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; }

.fb-check {
    padding: 14px;
    background: var(--wb-card, #fbf8f2);
    border: 1px solid var(--wb-border, #e9e2d5);
    border-radius: 12px;
}
.fb-check-row { display: flex; gap: 8px; }
.fb-input {
    flex: 1;
    min-width: 0;
    padding: 8px 11px;
    font-size: 12.5px;
    border-radius: 9px;
    border: 1px solid var(--wb-border, #e9e2d5);
    background: #fff;
    color: var(--wb-text, #33302b);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.fb-input:focus {
    border-color: var(--wb-accent-soft, #c0896d);
    box-shadow: 0 0 0 3px rgba(163, 90, 59, .1);
}
.fb-check-out {
    margin-top: 10px;
    font-size: 12.5px;
    line-height: 1.85;
    color: var(--wb-text-2, #6f685e);
}
.fb-check-out:empty { display: none; }
.fb-check-out b { display: block; font-size: 13px; margin-bottom: 2px; }
.fb-check-out span { color: var(--wb-muted, #a89f92); }
.fb-check-out.is-loading { color: var(--wb-muted, #a89f92); }
.fb-check-out.is-ok b { color: #4d7a35; }
.fb-check-out.is-warn b { color: #b07818; }
.fb-check-out.is-no b { color: #8d4b2c; }
.fb-check-out.is-bad { color: #b4493c; }

.fb-toast {
    position: fixed;
    left: 50%;
    bottom: 40px;
    transform: translate(-50%, 8px);
    padding: 8px 16px;
    border-radius: 9px;
    background: rgba(46, 44, 40, .94);
    color: #fff;
    font-size: 12px;
    z-index: 980;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    max-width: 76vw;
    text-align: center;
}
.fb-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.fb-toast.is-bad { background: rgba(150, 55, 45, .95); }

/* 窄屏：二维码在上，教程在下 */
@media (max-width: 760px) {
    .fb { padding: 14px 12px 26px; }
    .fb-hero { flex-direction: column; gap: 10px; padding: 14px; }
    .fb-hero-state { margin-left: 0; }
    .fb-grid { grid-template-columns: minmax(0, 1fr); }
    .fb-side { display: flex; flex-direction: column; align-items: center; }
    .fb-qr-frame { max-width: 210px; width: 100%; }
    .fb-side-btns { flex-direction: row; width: 100%; }
    .fb-side-btns .fb-btn { flex: 1; }
}
