/* ---------------------------------------------------------------
   微信公众号管理后台 - 自定义样式（配合 Layui 2.9）
   主题：浅色 + 微信绿 #07c160
   --------------------------------------------------------------- */

:root {
    --wx-green: #07c160;
    --wx-green-dark: #06ad56;
    --wx-green-light: #e8faf0;
    --wx-blue: #1e9fff;
    --wx-orange: #ffb800;
    --wx-red: #ff5722;
    --wx-border: #e6e8eb;
    --wx-text: #1f2329;
    --wx-text-sub: #8c939d;
    --wx-bg: #f4f6f8;
}

html, body {
    height: 100%;
    color: var(--wx-text);
    background: var(--wx-bg);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--wx-green); }

/* ---------------- 布局骨架 ---------------- */
.wb-layout { min-height: 100vh; }

.wb-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 220px;
    background: #ffffff;
    border-right: 1px solid var(--wx-border);
    overflow-y: auto;
    z-index: 1000;
    transition: width .2s ease;
}

.wb-sidebar .wb-logo {
    height: 58px;
    line-height: 58px;
    padding: 0 18px;
    font-size: 16px;
    font-weight: 600;
    color: var(--wx-text);
    border-bottom: 1px solid var(--wx-border);
    white-space: nowrap;
    overflow: hidden;
}

.wb-sidebar .wb-logo i {
    color: var(--wx-green);
    font-size: 20px;
    margin-right: 8px;
    vertical-align: -2px;
}

.wb-main {
    margin-left: 220px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .2s ease;
}

.wb-header {
    height: 58px;
    line-height: 58px;
    background: #ffffff;
    border-bottom: 1px solid var(--wx-border);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
}

.wb-header .wb-title { font-size: 15px; font-weight: 600; }

.wb-body {
    flex: 1;
    padding: 16px;
}

/* 折叠态 */
body.wb-collapsed .wb-sidebar { width: 60px; }
body.wb-collapsed .wb-main { margin-left: 60px; }
body.wb-collapsed .wb-sidebar .wb-logo span,
body.wb-collapsed .layui-nav-tree .layui-nav-more,
body.wb-collapsed .layui-nav-tree .layui-nav-item a cite { display: none; }

/* ---------------- 侧边菜单 ---------------- */
.wb-nav {
    border: none;
    background: transparent;
    padding-bottom: 40px;
}

.wb-nav .layui-nav-item a {
    color: #4e5969;
    height: 44px;
    line-height: 44px;
    padding-left: 20px;
    font-size: 14px;
    border-radius: 0;
}

.wb-nav .layui-nav-item a:hover { background: #f7f8fa; color: var(--wx-green); }
.wb-nav .layui-nav-itemed > a { color: var(--wx-text); font-weight: 600; background: #fafbfc; }
.wb-nav .layui-nav-item a cite { padding-left: 8px; }

.wb-nav .layui-nav-itemed > .layui-nav-child { background: #fbfcfd; }
.wb-nav .layui-nav-child dd a {
    padding-left: 52px;
    color: #5c6470;
    font-size: 13px;
    height: 40px;
    line-height: 40px;
}
.wb-nav .layui-nav-child dd a:hover { color: var(--wx-green); background: #f2f8f5; }
.wb-nav .layui-nav-child dd.layui-this a,
.wb-nav .layui-nav-item a.wb-active {
    color: var(--wx-green);
    background: var(--wx-green-light);
    border-right: 3px solid var(--wx-green);
}

/* ---------------- 内容卡片 ---------------- */
.wb-card {
    background: #fff;
    border: 1px solid var(--wx-border);
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 16px;
}

.wb-card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 14px;
    padding-left: 10px;
    border-left: 3px solid var(--wx-green);
    line-height: 1;
}

.wb-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.wb-toolbar .layui-form-item { margin-bottom: 0; }
.wb-toolbar .layui-input, .wb-toolbar .layui-select { height: 34px; }

/* 统计卡 */
.wb-stat-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.wb-stat {
    flex: 1 1 200px;
    background: #fff;
    border: 1px solid var(--wx-border);
    border-radius: 8px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.wb-stat .wb-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    flex: none;
}
.wb-stat .wb-stat-value { font-size: 24px; font-weight: 700; line-height: 1.2; }
.wb-stat .wb-stat-label { font-size: 13px; color: var(--wx-text-sub); }
.wb-stat .wb-stat-sub { font-size: 12px; color: var(--wx-text-sub); margin-top: 2px; }

/* ---------------- 按钮 ---------------- */
.layui-btn.wb-btn-green { background-color: var(--wx-green); }
.layui-btn.wb-btn-green:hover { background-color: var(--wx-green-dark); }
.layui-btn + .layui-btn { margin-left: 6px; }

/* ---------------- 表格 ---------------- */
.layui-table-view { border-radius: 6px; }
.layui-table th { background: #fafbfc !important; font-weight: 600; color: #4e5969; }
.layui-table-cell { height: auto; line-height: 28px; }

.wb-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 6px;
    background: #f0f2f5;
}

.wb-tag {
    display: inline-block;
    padding: 1px 8px;
    font-size: 12px;
    border-radius: 10px;
    background: #f2f3f5;
    color: #5c6470;
    margin-right: 4px;
}
.wb-tag-green { background: var(--wx-green-light); color: var(--wx-green); }
.wb-tag-gray { background: #f2f3f5; color: #99a0aa; }
.wb-tag-blue { background: #e8f3ff; color: var(--wx-blue); }
.wb-tag-orange { background: #fff7e6; color: #d48806; }
.wb-tag-red { background: #fff1f0; color: var(--wx-red); }

/* ---------------- 菜单模拟器 ---------------- */
.wb-sim-wrap {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.wb-phone {
    width: 320px;
    flex: none;
    background: #f7f8fa;
    border-radius: 22px;
    border: 1px solid #dfe2e6;
    padding: 10px 8px 0;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .06);
}

.wb-phone-head {
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    font-size: 12px;
    color: #8c939d;
}

.wb-phone-head .wb-phone-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #dfe2e6;
}

.wb-phone-title {
    text-align: center;
    font-size: 13px;
    color: #4e5969;
    padding: 6px 0;
    background: #f7f8fa;
}

.wb-phone-body {
    min-height: 300px;
    background: #fff;
    border-radius: 10px 10px 0 0;
    padding: 20px 14px;
    color: #b7bcc4;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.wb-menu-bar {
    display: flex;
    background: #fff;
    border-top: 1px solid #eceef1;
    border-radius: 0;
    min-height: 50px;
}

.wb-menu-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    padding: 6px 2px;
    border-right: 1px solid #f2f3f5;
}
.wb-menu-col:last-child { border-right: none; }

.wb-menu-col > .wb-menu-name {
    font-size: 13px;
    color: #333;
    line-height: 20px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.wb-menu-col.wb-active { background: #f7f8fa; }
.wb-menu-col.wb-empty .wb-menu-name { color: #c4c9d0; }
.wb-menu-col.wb-add { color: #b7bcc4; font-size: 20px; }

.wb-sub-list {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    background: #fff;
    border: 1px solid #eceef1;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, .06);
    overflow: hidden;
    display: none;
    z-index: 10;
}

.wb-menu-col.wb-open .wb-sub-list { display: block; }

.wb-sub-list .wb-sub-item {
    padding: 10px 12px;
    font-size: 13px;
    color: #333;
    text-align: center;
    border-bottom: 1px solid #f2f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.wb-sub-list .wb-sub-item:last-child { border-bottom: none; }
.wb-sub-list .wb-sub-item:hover { background: #f7f8fa; }
.wb-sub-list .wb-sub-item.wb-active { background: var(--wx-green-light); color: var(--wx-green); }
.wb-sub-list .wb-sub-item.wb-add { color: #b7bcc4; }

.wb-editor { flex: 1; min-width: 320px; }

.wb-menu-tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--wx-border);
    border-radius: 6px;
    margin-bottom: 8px;
    background: #fff;
}
.wb-menu-tree-item .wb-menu-tree-name { font-weight: 600; flex: 1; }
.wb-menu-tree-item.wb-child { margin-left: 28px; }

/* ---------------- Markdown 编辑器 ---------------- */
.wb-md-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    background: #fafbfc;
    border: 1px solid var(--wx-border);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}
.wb-md-toolbar button {
    height: 28px;
    line-height: 26px;
    padding: 0 10px;
    font-size: 12px;
    border: 1px solid var(--wx-border);
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    color: #4e5969;
}
.wb-md-toolbar button:hover { border-color: var(--wx-green); color: var(--wx-green); }

.wb-md-panes {
    display: flex;
    border: 1px solid var(--wx-border);
    border-radius: 0 0 6px 6px;
    overflow: hidden;
    min-height: 460px;
}
.wb-md-panes textarea {
    flex: 1;
    border: none;
    border-right: 1px solid var(--wx-border);
    padding: 14px;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 14px;
    line-height: 1.7;
    resize: none;
    outline: none;
    color: #1f2329;
    background: #fff;
    min-height: 460px;
}
.wb-md-preview {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
    max-height: 640px;
    background: #fff;
    word-break: break-word;
}
.wb-md-preview img { max-width: 100%; }

.wb-word-count { font-size: 12px; color: var(--wx-text-sub); text-align: right; padding-top: 6px; }

/* ---------------- 登录页 ---------------- */
.wb-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8faf0 0%, #f4f6f8 45%, #e8f3ff 100%);
}
.wb-login-box {
    width: 380px;
    background: #fff;
    border-radius: 12px;
    padding: 34px 32px 26px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .08);
}
.wb-login-box h2 {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 6px;
    color: var(--wx-text);
}
.wb-login-box .wb-login-sub {
    text-align: center;
    font-size: 13px;
    color: var(--wx-text-sub);
    margin-bottom: 24px;
}
.wb-login-box .layui-input { height: 42px; line-height: 42px; }
.wb-login-box .layui-btn { width: 100%; height: 42px; line-height: 42px; font-size: 15px; }
.wb-captcha-img {
    height: 42px;
    border: 1px solid var(--wx-border);
    border-radius: 4px;
    cursor: pointer;
    display: block;
    width: 110px;
    object-fit: cover;
}
.wb-login-tip {
    margin-top: 18px;
    font-size: 12px;
    color: var(--wx-text-sub);
    text-align: center;
    line-height: 1.8;
}

/* ---------------- 表单 ---------------- */
.wb-form-tip { font-size: 12px; color: var(--wx-text-sub); margin-top: 4px; line-height: 1.6; }
.wb-required::after { content: " *"; color: var(--wx-red); }

.wb-kv-list { font-size: 13px; }
.wb-kv-list .wb-kv-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px dashed var(--wx-border);
}
.wb-kv-list .wb-kv-row:last-child { border-bottom: none; }
.wb-kv-list .wb-kv-key { width: 110px; color: var(--wx-text-sub); flex: none; }
.wb-kv-list .wb-kv-val { flex: 1; word-break: break-all; }

.wb-msg-bubble {
    background: #f7f8fa;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.7;
    word-break: break-word;
    white-space: pre-wrap;
}

.wb-empty {
    text-align: center;
    color: var(--wx-text-sub);
    padding: 60px 0;
    font-size: 13px;
}

.wb-result-html {
    border: 1px solid var(--wx-border);
    border-radius: 6px;
    padding: 18px;
    max-height: 520px;
    overflow-y: auto;
    background: #fff;
}

.wb-scroll-260 { max-height: 260px; overflow-y: auto; }
.wb-scroll-380 { max-height: 380px; overflow-y: auto; }

/* layui 细节微调 */
.layui-layer-title { font-size: 15px !important; font-weight: 600; }
.layui-form-label { width: 100px; }
.layui-input-block { margin-left: 130px; }
.wb-form .layui-form-label { float: none; text-align: left; width: auto; padding: 0 0 6px; }
.wb-form .layui-input-block { margin-left: 0; }
