/* @Title static/whiteboard/app.css  思维导图 · drawnix 风格（2026-10-26）
 *
 * 视觉口径照 https://drawnix.com/：
 *   · 画布铺满整页，UI 是**浮在画布上的白色圆角面板**（细阴影、无边框）；
 *   · 工具是图标按钮（1.6px 描边线性图标），选中态＝浅蓝底 + 蓝图标；
 *   · 左上「菜单 + 撤销/重做」、顶部居中「工具」、右上「缩放」、右下「当前导图 + 更多」。
 */

:root {
    --wb-panel: #ffffff;
    --wb-shadow: 0 2px 10px rgba(0, 0, 0, .08), 0 0 1px rgba(0, 0, 0, .12);
    --wb-shadow-up: 0 8px 28px rgba(0, 0, 0, .16);
    --wb-line: #e9ecef;
    --wb-icon: #3f4448;
    --wb-icon-hover: #f1f3f5;
    --wb-active-bg: #e8f0fe;
    --wb-active: #1a73e8;
    --wb-sub: #8b949e;
    --wb-danger: #d93025;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: var(--wb-canvas-bg, #fff);
    color: #1f2328;
    font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.wb-app { position: relative; width: 100%; height: 100%; }

#wb-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: default;
}

/* ---------- 浮动面板 ---------- */
.wb-panel {
    position: absolute;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    background: var(--wb-panel);
    border-radius: 12px;
    box-shadow: var(--wb-shadow);
}
/* 左上角：一整行（☰・撤销・重做・导图切换・新建），不换行 */
.wb-panel-tl { left: 12px; top: 12px; }
.wb-panel-tools { left: 50%; top: 12px; transform: translateX(-50%); }
.wb-panel-zoom { right: 12px; top: 12px; }
.wb-panel-theme { right: 12px; bottom: 12px; padding: 4px 8px; }

/* ---------- 图标按钮 ---------- */
.wb-ic {
    width: 34px; height: 30px;
    display: grid; place-items: center;
    border: 0; border-radius: 8px;
    background: transparent; color: var(--wb-icon);
    cursor: pointer; padding: 0;
}
.wb-ic svg {
    width: 18px; height: 18px;
    fill: none; stroke: currentColor; stroke-width: 1.6;
    stroke-linecap: round; stroke-linejoin: round;
}
.wb-ic:hover { background: var(--wb-icon-hover); }
.wb-ic:disabled { opacity: .4; cursor: not-allowed; }
.wb-tool.is-on { background: var(--wb-active-bg); color: var(--wb-active); }
.wb-vline { width: 1px; height: 20px; background: var(--wb-line); margin: 0 3px; flex: 0 0 auto; }

/* ---------- 缩放 ---------- */
.wb-pct {
    min-width: 56px; height: 28px;
    border: 0; border-radius: 8px;
    background: transparent; color: #333;
    font-size: 13px; cursor: pointer;
}
.wb-pct:hover { background: var(--wb-icon-hover); }

/* ---------- 当前导图（在左上角面板里） ---------- */
.wb-select {
    height: 28px; max-width: 150px;
    border: 0; border-radius: 8px;
    background: transparent; color: #333;
    font-size: 13px; padding: 0 4px; cursor: pointer; outline: none;
}
.wb-status, .wb-quota { font-size: 12px; color: var(--wb-sub); white-space: nowrap; }
.wb-status { margin-left: auto; padding-left: 6px; }
.wb-status.is-saving { color: var(--wb-active); }
.wb-status.is-error { color: var(--wb-danger); }

.wb-login {
    height: 28px; display: inline-flex; align-items: center;
    margin-left: auto; padding: 0 10px; border-radius: 8px;
    background: var(--wb-active); color: #fff;
    font-size: 13px; text-decoration: none; white-space: nowrap;
}
.wb-login:hover { background: #1765cc; }
.wb-login[hidden] { display: none; }

/* ---------- 下拉菜单 ---------- */
.wb-more { position: relative; }
.wb-drop {
    position: absolute;
    min-width: 190px;
    padding: 6px;
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--wb-shadow-up);
    z-index: 20;
}
#wb-more-menu { top: 38px; right: 0; }
/* 左上角 ☰ 的应用菜单：从整块卡片下沿展开；项数多，限高可滚 */
#wb-app-menu {
    top: calc(100% + 6px); left: 0;
    min-width: 208px;
    max-height: calc(100vh - 132px);
    overflow-y: auto;
}

/* ---------- 菜单顶部的用户块（头像 + 微信名） ---------- */
.wb-user {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 8px; border-radius: 8px;
    text-decoration: none; color: inherit;
}
.wb-user:hover { background: #f5f7f9; }
.wb-user.is-static { cursor: default; }
.wb-user.is-static:hover { background: transparent; }
.wb-avatar {
    width: 30px; height: 30px; flex: 0 0 30px;
    border-radius: 50%; object-fit: cover;
    background: #e8f0fe; color: var(--wb-active);
}
.wb-avatar[hidden] { display: none; }
.wb-avatar-ph {
    display: grid; place-items: center;
    font-size: 14px; font-weight: 600; user-select: none;
}
.wb-user-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.wb-user-txt b {
    font-size: 13px; font-weight: 600; color: #1f2328;
    max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wb-user-txt i { font-size: 11px; font-style: normal; color: var(--wb-sub); }
.wb-drop button {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    width: 100%; padding: 8px 10px;
    border: 0; border-radius: 8px;
    background: transparent; color: #333;
    font-size: 13px; text-align: left; cursor: pointer;
}
.wb-drop button:hover { background: #f5f7f9; }
.wb-drop .wb-danger { color: var(--wb-danger); }
.wb-drop .wb-dline { display: block; height: 1px; background: var(--wb-line); margin: 4px 2px; }
.wb-drop kbd {
    font: 11px/1 ui-monospace, monospace;
    color: var(--wb-sub); background: #f3f5f7;
    border-radius: 4px; padding: 3px 5px;
}
.wb-drop .wb-row {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 6px 10px; font-size: 13px; color: #555;
}
.wb-drop input[type=color] {
    width: 34px; height: 24px; padding: 0;
    border: 1px solid var(--wb-line); border-radius: 6px; background: #fff;
}
.wb-drop input[type=range] { width: 104px; }

/* ---------- 内联编辑框 ---------- */
.wb-editor {
    position: absolute;
    z-index: 30;
    margin: 0; padding: 4px 8px;
    border: 2px solid var(--wb-active);
    border-radius: 8px;
    background: #fff; color: #1f2328;
    font-family: inherit; line-height: 1.3;
    resize: none; outline: none;
    box-shadow: 0 6px 20px rgba(26, 115, 232, .22);
}

/* ---------- 提示条 ---------- */
.wb-tip {
    position: absolute;
    left: 50%; bottom: 64px;
    transform: translateX(-50%);
    max-width: min(560px, 92vw);
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(31, 35, 40, .92);
    color: #fff; font-size: 13px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
    z-index: 20;
}
.wb-tip a { color: #93c5fd; }

/* ---------- 小屏 ---------- */
/* 左上角面板约 260px 宽，顶部居中工具条约 294px：窗口窄于 ~880px 时两者会撞，
   所以窄屏把工具条放到底部居中（不碰左上，拇指也更好按） */
@media (max-width: 1020px) {
    .wb-panel-tools { top: auto; bottom: 12px; }
}
@media (max-width: 720px) {
    .wb-ic { width: 31px; }
    .wb-select { max-width: 96px; }
    #wb-zoom-val { min-width: 44px; }
    .wb-tip { bottom: 64px; }
    /* 底边中间已经被工具条占了，风格切换改到右上（缩放条下面） */
    .wb-panel-theme { right: 12px; top: 56px; bottom: auto; }
}

/* ---------- 选中节点后的浮动样式条（照 drawnix：一行图标，细项收进小浮层） ---------- */
.wb-style {
    z-index: 12;
    padding: 4px 6px;
    gap: 2px;
    max-width: calc(100vw - 24px);
}
.wb-style[hidden] { display: none; }

.wb-sbtn-wrap { position: relative; display: flex; }

/* 颜色按钮：中间那块色块＝当前边框色，一眼看出"这个节点现在什么色" */
.wb-ic.wb-cbtn { width: 34px; }
.wb-cswatch {
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, .14);
    background: #2563eb;
}
.wb-ic.wb-fsbtn { width: 34px; font-size: 13px; font-weight: 600; color: #374151; }
.wb-ic.wb-bi { width: 28px; font-size: 14px; color: #374151; }
.wb-ic.wb-bi.is-on { background: var(--wb-active-bg); color: var(--wb-active); }
.wb-ic.wb-shape.is-on { background: var(--wb-active-bg); color: var(--wb-active); }
.wb-ic.wb-danger:hover { background: #fee2e2; color: var(--wb-danger); }

/* 小浮层 */
.wb-spop {
    top: calc(100% + 8px);
    left: 0;
    min-width: 0;
    width: max-content;          /* 让两行色板按内容撑开，不要被 190px 的最小宽度限制挤成竖条 */
    max-width: calc(100vw - 24px);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.wb-spop[hidden] { display: none; }
.wb-srow { display: flex; align-items: center; gap: 4px; }
.wb-sdots { display: flex; align-items: center; gap: 3px; flex-wrap: nowrap; }
.wb-slabel { font-size: 11px; color: var(--wb-sub); width: 26px; flex: 0 0 26px; }

.wb-style .wb-dot {
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, .12);
    background: var(--c, #fff);
    padding: 0; cursor: pointer;
}
.wb-style .wb-dot:hover { transform: scale(1.12); }
.wb-style .wb-dot.is-on { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--wb-active); }
.wb-style .wb-dot.is-theme {
    background: #fff;
    background-image: linear-gradient(135deg, transparent 45%, #c9d3e0 45%, #c9d3e0 55%, transparent 55%);
}
.wb-style .wb-dot.is-none {
    background: #fff;
    background-image: linear-gradient(45deg, #e5e9ef 25%, transparent 25%, transparent 75%, #e5e9ef 75%),
                      linear-gradient(45deg, #e5e9ef 25%, transparent 25%, transparent 75%, #e5e9ef 75%);
    background-size: 8px 8px;
    background-position: 0 0, 4px 4px;
}

/* 字号列表 */
.wb-fssizes { gap: 2px; }
.wb-style .wb-fssizes button {
    min-width: 30px; height: 26px;
    border: 0; border-radius: 7px;
    background: transparent; color: #374151;
    font-size: 12px; cursor: pointer;
}
.wb-style .wb-fssizes button:hover { background: #f5f7f9; }
.wb-style .wb-fssizes button.is-on { background: var(--wb-active-bg); color: var(--wb-active); font-weight: 600; }
.wb-style .wb-smore {
    border: 0; border-radius: 7px;
    background: transparent; color: var(--wb-sub);
    font-size: 11px; text-align: left;
    padding: 5px 4px; cursor: pointer;
}
.wb-style .wb-smore:hover { background: #f5f7f9; color: #374151; }

@media (max-width: 720px) {
    /* 手机上样式条贴底（工具条已经占了底边中间，往上抬一层） */
    .wb-style { bottom: 58px; top: auto !important; left: 8px !important; right: 8px; }
    .wb-spop { top: auto; bottom: calc(100% + 8px); }
}
