/* ==========================================================================
   云湖机器人托管 · 样式
   ========================================================================== */

:root {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --surface-2: #fafbfe;
    --surface-3: #f1f3f9;
    --border: #e7e9f2;
    --border-strong: #d8dbe8;

    --text: #171a26;
    --text-2: #5a6079;
    --text-3: #8b90a6;

    --brand: #2b5cff;
    --brand-hover: #1e4ae0;
    --brand-weak: #eef2ff;
    --brand-ring: rgba(43, 92, 255, .18);

    --ok: #0f9d58;
    --ok-weak: #e8f7ef;
    --warn: #c27508;
    --warn-weak: #fdf3e3;
    --bad: #dc2f2f;
    --bad-weak: #fdecec;
    --purple: #7c3aed;
    --purple-weak: #f3eeff;

    --radius-lg: 16px;
    --radius: 12px;
    --radius-sm: 8px;

    --shadow-xs: 0 1px 2px rgba(21, 26, 45, .04);
    --shadow-sm: 0 2px 6px -2px rgba(21, 26, 45, .08);
    --shadow: 0 12px 32px -18px rgba(21, 26, 45, .28);

    --sidebar-w: 244px;
    --topbar-h: 64px;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

/* hidden 属性必须压过组件自己的 display，否则抽屉/弹窗会一直显示 */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }

.icon { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.small { font-size: 12.5px; }
.text-sm { font-size: 16px; }
.muted { color: var(--text-3); }
.muted-text { color: var(--text-2); font-size: 13px; }
.text-ok { color: var(--ok); }
.optional { color: var(--text-3); font-weight: 400; font-size: 12px; margin-left: 2px; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px;
    padding: 0 15px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background .16s, border-color .16s, box-shadow .16s, transform .06s;
    background: transparent;
    color: var(--text);
}
.btn:active { transform: translateY(.5px); }

.btn-primary {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 1px 2px rgba(43, 92, 255, .3), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover { background: var(--brand-hover); color: #fff; }
.btn-primary .icon { color: #fff; }

.btn-ghost {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-2);
    box-shadow: var(--shadow-xs);
}
.btn-ghost:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface); }

.btn-danger {
    background: var(--bad);
    color: #fff;
}
.btn-danger:hover { background: #c62626; color: #fff; }

.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn-sm .icon { width: 15px; height: 15px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-3);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

/* ---------- 表单 ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 6px;
}
.field-sm { max-width: 120px; }

.input {
    width: 100%;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-size: 13.5px;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
    resize: vertical;
}
.input.mono { font-family: var(--mono); font-size: 12.5px; }
.input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
}
.input::placeholder { color: var(--text-3); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5 6 8.5 10 4.5' fill='none' stroke='%238b90a6' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px; }

.hint { font-size: 12px; color: var(--text-3); line-height: 1.55; }
.field-row { display: flex; gap: 14px; }
.field-row > .field { flex: 1; min-width: 0; }

.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--brand); }

.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.form-note { font-size: 12.5px; color: var(--text-2); }
.form-section {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-3);
    margin-top: 8px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

/* ---------- 卡片 ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-xs);
}
.card-flush { padding: 0; overflow: hidden; }
.card-muted { background: var(--surface-2); }
.card-danger { border-color: #f3d6d6; background: #fffafa; }
.card-danger .btn-danger { margin-top: 12px; }

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.card-head h2 { font-size: 15px; }
.card-hint { font-size: 12px; color: var(--text-3); }

.stack { display: flex; flex-direction: column; gap: 18px; }

/* ---------- 徽章 / 提示 ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-weak); color: var(--ok); }
.badge-warn { background: var(--warn-weak); color: var(--warn); }
.badge-bad { background: var(--bad-weak); color: var(--bad); }
.badge-muted { background: var(--surface-3); color: var(--text-2); }

.banner {
    display: flex;
    gap: 14px;
    padding: 16px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    margin-bottom: 20px;
}
.banner .icon { color: var(--warn); margin-top: 2px; }
.banner strong { display: block; font-size: 13.5px; margin-bottom: 3px; }
.banner p { font-size: 13px; color: var(--text-2); }
.banner code {
    display: inline-block;
    margin-top: 8px;
    padding: 5px 10px;
    border-radius: 7px;
    background: #1b2030;
    color: #d6e2ff;
    font-family: var(--mono);
    font-size: 12.5px;
}
.banner-warn { background: var(--warn-weak); border-color: #f3e0c2; }

.deploy-warn { display: block; padding: 12px 16px; }
.deploy-warn summary {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    list-style: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--warn);
}
.deploy-warn summary::-webkit-details-marker { display: none; }
.deploy-warn summary small { margin-left: auto; font-weight: 400; color: var(--text-3); font-size: 11.5px; }
.deploy-warn[open] summary { margin-bottom: 10px; }
.warn-list { display: flex; flex-direction: column; gap: 7px; padding-left: 28px; }
.warn-list li {
    position: relative;
    font-size: 12.5px;
    font-weight: 400;
    color: var(--text-2);
    line-height: 1.65;
}
/* Webhook 订阅地址卡片 */
.webhook-card {
    border-color: #cfdcff;
    background: linear-gradient(180deg, #fbfcff 0%, #ffffff 42%);
    margin-bottom: 20px;
}
.webhook-card .card-head h2 { display: flex; align-items: center; gap: 8px; }
.webhook-card .card-head h2 .icon { color: var(--brand); }
.webhook-card > .muted-text { margin: -4px 0 14px; line-height: 1.8; }

.wh-lead {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.75;
    margin: -4px 0 12px;
}
.wh-lead b { color: var(--text); }

.webhook-url {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 9px 9px 9px 15px;
    border: 1px solid var(--border-strong);
    border-radius: 11px;
    background: #f7f9ff;
}
.webhook-url code {
    flex: 1;
    min-width: 200px;
    font-family: var(--mono);
    font-size: 14px;
    color: #1e3a8a;
    word-break: break-all;
    user-select: all;
    line-height: 1.5;
}
.webhook-url .btn { flex: none; margin-left: auto; }
.wh-host { color: #7c88ad; }
.wh-path { color: #17306e; font-weight: 600; }
.wh-path em {
    font-style: normal;
    padding: 1px 5px;
    border-radius: 4px;
    background: #dfe8ff;
    color: #1a3fa8;
}

.wh-note {
    font-size: 12px;
    color: var(--text-3);
    line-height: 1.7;
    margin-top: 8px;
}
.wh-note b { font-family: var(--mono); color: var(--text-2); }

/* 改短码：折叠按钮 + 内联表单 */
.slug-editor { display: contents; }
.slug-editor summary { list-style: none; cursor: pointer; }
.slug-editor summary::-webkit-details-marker { display: none; }
.slug-editor[open] summary { display: none; }
.slug-form {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 5px 4px 10px;
    border: 1px solid var(--brand);
    border-radius: 9px;
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--brand-ring);
}
.slug-static { font-family: var(--mono); font-size: 12.5px; color: var(--text-3); }
.slug-form .input {
    width: 128px;
    height: 28px;
    min-height: 28px;
    padding: 0 8px;
    font-size: 12.5px;
}

.webhook-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.webhook-actions form { display: contents; }
.webhook-actions .hint { margin-left: auto; }

.webhook-test-result {
    margin-top: 12px;
    padding: 10px 13px;
    border-radius: 9px;
    font-size: 12.5px;
    line-height: 1.7;
    background: var(--ok-weak);
    color: #0b7a45;
    border: 1px solid #cceedd;
}
.webhook-test-result.is-error { background: var(--bad-weak); color: #a82323; border-color: #f6d5d5; }
.webhook-test-result ul { margin: 6px 0 0; padding-left: 18px; list-style: disc; }
.webhook-test-result li { margin: 3px 0; }

.webhook-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    padding: 9px 12px;
    border-radius: 9px;
    background: var(--warn-weak);
    color: var(--text-2);
    font-size: 12px;
    line-height: 1.6;
}
.webhook-tip .icon { color: var(--warn); margin-top: 1px; }

.warn-list li::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 8px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--warn);
}

.alert {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
}
.alert .icon { margin-top: 2px; }
.alert-error { background: var(--bad-weak); color: #a82323; border: 1px solid #f6d5d5; }

.flashes { margin-bottom: 18px; display: flex; flex-direction: column; gap: 10px; }
.flash {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    animation: slideDown .25s ease;
}
.flash-success { background: var(--ok-weak); color: #0b7a45; }
.flash-error { background: var(--bad-weak); color: #a82323; }

@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- 空状态 ---------- */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 44px 20px;
    text-align: center;
    color: var(--text-3);
}
.empty .icon { width: 34px; height: 34px; color: var(--border-strong); }
.empty h2 { font-size: 15px; color: var(--text); margin-top: 4px; }
.empty p { font-size: 13.5px; color: var(--text-2); }
.empty small { font-size: 12.5px; }
.empty .btn { margin-top: 8px; }
.empty.compact { padding: 26px 16px; }
.empty-card { padding: 0; }

/* ---------- 主框架 ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex: none;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 30;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 20px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
    width: 34px; height: 34px; flex: none;
    display: grid; place-items: center;
    border-radius: 10px;
    background: linear-gradient(140deg, #3f6dff, #6a4bff);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -.02em;
    box-shadow: 0 4px 10px -4px rgba(43, 92, 255, .7);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 14px; }
.brand-text small { font-size: 10.5px; color: var(--text-3); letter-spacing: .08em; text-transform: uppercase; }
.brand-lg .brand-mark { width: 40px; height: 40px; font-size: 15px; }

.nav { position: relative; display: flex; flex-direction: column; gap: 3px; }

/* 滑动高亮块：切换菜单时从上一项滑到当前项（位置由 JS 计算） */
.nav-glow {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    /* 兜底高度，JS 拿到真实尺寸后会覆盖 */
    height: 38px;
    border-radius: 9px;
    background: var(--brand-weak);
    opacity: 0;
    transform: translateY(0);
    transition: transform .24s cubic-bezier(.25, .7, .35, 1), height .15s ease, opacity .16s ease;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}

/* 左边缘的小竖条，跟随高亮块一起滑 */
.nav-glow::after {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 3px;
    height: 15px;
    margin-top: -7.5px;
    border-radius: 0 3px 3px 0;
    background: var(--brand);
    opacity: .9;
    transform: scaleY(1);
    transition: transform .24s cubic-bezier(.25, .7, .35, 1);
}

.nav-item {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 9px;
    color: var(--text-2);
    font-size: 13.5px;
    font-weight: 500;
    transition: background .14s, color .14s;
}
.nav-item .icon {
    color: var(--text-3);
    transition: color .16s;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item:hover .icon { color: var(--text-2); }

.nav-item.is-active { background: var(--brand-weak); color: var(--brand); }
.nav-item.is-active .icon { color: var(--brand); }

/* 高亮块就绪后，背景交给它画，避免两层色块叠在一起 */
.nav.is-glow-ready .nav-item.is-active,
.nav.is-glow-ready .nav-item.is-active:hover { background: transparent; }

/* 切到这一项时，图标淡入即可，不做缩放旋转 */
.nav-item.is-active .icon {
    animation: navIconIn .26s ease-out both;
}

@keyframes navIconIn {
    from { opacity: .55; }
    to   { opacity: 1; }
}

.nav-item-dashed { border: 1px dashed var(--border-strong); margin-top: 8px; color: var(--text-3); }

.nav-item-dashed:hover { border-color: var(--brand); color: var(--brand); }

/* 移动端汉堡按钮：展开时只做轻微变色，不旋转 */
[data-toggle-sidebar] .icon {
    transition: color .15s;
}
body.nav-open [data-toggle-sidebar] .icon {
    color: var(--brand);
}

@media (prefers-reduced-motion: reduce) {
    .nav-glow,
    .nav-item,
    .nav-item .icon,
    [data-toggle-sidebar] .icon {
        transition: none !important;
        animation: none !important;
    }
}

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding-top: 16px; }

.worker-chip {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 11px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.worker-chip strong { display: block; font-size: 12px; font-weight: 600; }
.worker-chip small { font-size: 11px; color: var(--text-3); }
.pulse { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--text-3); }
.worker-chip.is-on .pulse { background: var(--ok); box-shadow: 0 0 0 3px rgba(15, 157, 88, .16); animation: pulse 2.4s infinite; }
.worker-chip.is-off .pulse { background: var(--bad); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 2px rgba(15, 157, 88, .18); } 50% { box-shadow: 0 0 0 5px rgba(15, 157, 88, .04); } }

.user-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.avatar {
    width: 30px; height: 30px; flex: none;
    display: grid; place-items: center;
    border-radius: 9px;
    background: var(--surface-3);
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 600;
}
.user-meta { flex: 1; min-width: 0; line-height: 1.3; }
.user-meta strong { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { font-size: 11px; color: var(--text-3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 28px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar h1 { font-size: 15px; font-weight: 600; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }
.only-mobile { display: none; }

.content { padding: 26px 28px 60px; max-width: 1360px; width: 100%; }

/* ---------- 页面头 ---------- */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.page-head-main { min-width: 0; }
.page-title { font-size: 22px; display: flex; align-items: center; gap: 10px; letter-spacing: -.02em; }
.page-desc { font-size: 13px; color: var(--text-2); margin-top: 5px; }
.page-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.back-link { font-size: 12.5px; color: var(--text-3); display: inline-block; margin-bottom: 6px; }
.back-link:hover { color: var(--brand); }

/* ---------- 统计 ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 15px 16px 13px;
    box-shadow: var(--shadow-xs);
}
.stat-label { font-size: 12px; color: var(--text-3); display: block; }
.stat strong {
    display: block;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -.03em;
    line-height: 1.25;
    margin: 2px 0 1px;
    font-variant-numeric: tabular-nums;
}
.stat small { font-size: 11.5px; color: var(--text-3); }

/* ---------- 网格 ---------- */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-form { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }

/* ---------- 机器人列表 ---------- */
.bot-list { display: flex; flex-direction: column; }
.bot-list li + li { border-top: 1px solid var(--border); }
.bot-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 6px;
    margin: 0 -6px;
    border-radius: 10px;
    color: var(--text);
}
.bot-row:hover { background: var(--surface-2); color: var(--text); }
.bot-avatar {
    width: 34px; height: 34px; flex: none;
    display: grid; place-items: center;
    border-radius: 10px;
    background: var(--brand-weak);
    color: var(--brand);
    font-weight: 600;
    font-size: 13px;
}
.bot-avatar.lg { width: 42px; height: 42px; font-size: 15px; border-radius: 12px; }
.bot-main { flex: 1; min-width: 0; line-height: 1.35; }
.bot-main strong { display: block; font-size: 13.5px; }
.bot-main small { font-size: 11.5px; color: var(--text-3); }
.chev { color: var(--text-3); width: 15px; height: 15px; }

.bot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.bot-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-xs);
    transition: border-color .18s, box-shadow .18s, transform .18s;
}
.bot-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.bot-card-head { display: flex; align-items: center; gap: 11px; }
.bot-card-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bot-card-title h3 { font-size: 14.5px; }
.bot-card-menu { margin-left: auto; }

.bot-metrics { display: flex; gap: 18px; padding: 12px 0 0; border-top: 1px solid var(--border); }
.bot-metrics > div { min-width: 0; }
.bot-metrics dt { font-size: 11px; color: var(--text-3); }
.bot-metrics dd { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bot-metrics dd.mono { font-weight: 400; color: var(--text-2); }
.bot-error { font-size: 11.5px; color: var(--warn); background: var(--warn-weak); padding: 6px 9px; border-radius: 7px; }
.bot-card-foot { display: flex; gap: 7px; margin-top: auto; flex-wrap: wrap; }
.bot-card-foot form { display: contents; }

.bot-card-new {
    align-items: center;
    justify-content: center;
    border-style: dashed;
    background: transparent;
    color: var(--text-3);
    min-height: 180px;
    gap: 6px;
}
.bot-card-new:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-weak); }
.bot-card-new .icon { width: 22px; height: 22px; }
.bot-card-new small { font-size: 11px; }

/* ---------- 活动流 ---------- */
.feed { display: flex; flex-direction: column; gap: 2px; }
.feed-item { display: flex; gap: 11px; padding: 9px 0; }
.feed-item + .feed-item { border-top: 1px solid var(--border); }
.feed-icon {
    width: 26px; height: 26px; flex: none;
    display: grid; place-items: center;
    border-radius: 8px;
    background: var(--surface-3);
    color: var(--text-3);
}
.feed-icon .icon { width: 14px; height: 14px; }
.feed-in .feed-icon { background: var(--brand-weak); color: var(--brand); }
.feed-out .feed-icon { background: var(--ok-weak); color: var(--ok); }
.feed-sys .feed-icon { background: var(--warn-weak); color: var(--warn); }
.feed-body { min-width: 0; flex: 1; }
.feed-meta { display: flex; gap: 8px; align-items: baseline; }
.feed-meta strong { font-size: 12.5px; }
.feed-meta span { font-size: 11px; color: var(--text-3); }
.feed-body p { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------- 步骤 ---------- */
.steps { display: flex; flex-direction: column; gap: 16px; }
.steps li { display: flex; gap: 11px; }
.step-no {
    width: 22px; height: 22px; flex: none;
    display: grid; place-items: center;
    border-radius: 7px;
    background: var(--brand-weak);
    color: var(--brand);
    font-size: 11.5px;
    font-weight: 600;
    margin-top: 1px;
}
.steps strong { display: block; font-size: 13px; }
.steps p { font-size: 12.5px; color: var(--text-2); }
.link-arrow { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; margin-top: 18px; }
.link-arrow .icon { width: 14px; height: 14px; }

/* ---------- 迷你日志 ---------- */
.mini-log { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; }
.mini-log li { display: flex; gap: 10px; align-items: baseline; }
.mini-log-time { color: var(--text-3); font-family: var(--mono); font-size: 11px; flex: none; }
.mini-log-text { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-log-out .mini-log-text { color: var(--ok); }
.mini-log-sys .mini-log-text { color: var(--warn); }

/* ---------- 日志表 ---------- */
.log-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.log-table th {
    text-align: left;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-3);
    padding: 11px 16px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.log-table td { padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.log-table tr:last-child td { border-bottom: none; }
.log-table tr:hover td { background: var(--surface-2); }
.log-text { color: var(--text); line-height: 1.6; word-break: break-word; }
.log-text .muted { display: block; font-size: 11.5px; }

.dir-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.dir-in { background: var(--brand-weak); color: var(--brand); }
.dir-out { background: var(--ok-weak); color: var(--ok); }
.dir-sys { background: var(--warn-weak); color: var(--warn); }

.tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 14px; }
.tab {
    padding: 6px 13px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-2);
}
.tab:hover { background: var(--surface-3); color: var(--text); }
.tab.is-active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-xs); font-weight: 500; }
.tabs-hint { margin-left: auto; font-size: 12px; color: var(--text-3); }

/* ---------- 登录 ---------- */
.auth-body { background: var(--surface); }
.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }

.auth-aside {
    background: linear-gradient(160deg, #14224a 0%, #23336b 45%, #2b3f8f 100%);
    color: #fff;
    padding: 40px 48px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}
.auth-aside::after {
    content: "";
    position: absolute;
    width: 420px; height: 420px;
    right: -140px; bottom: -160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(120, 160, 255, .35), transparent 65%);
}
.auth-aside .brand { color: #fff; }
.auth-aside .brand-text small { color: rgba(255, 255, 255, .5); }

.auth-pitch { margin: auto 0; max-width: 380px; position: relative; z-index: 1; }
.auth-pitch h2 { font-size: 30px; line-height: 1.35; letter-spacing: -.02em; margin-bottom: 16px; }
.auth-pitch p { font-size: 14px; color: rgba(255, 255, 255, .72); line-height: 1.8; }
.pitch-list { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; }
.pitch-list li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: rgba(255, 255, 255, .82); }
.pitch-list .icon { color: #8fb0ff; }
.auth-foot { font-size: 11.5px; color: rgba(255, 255, 255, .4); position: relative; z-index: 1; }

.auth-panel { display: grid; place-items: center; padding: 40px; }
.auth-card { width: 100%; max-width: 366px; }
.auth-head { margin-bottom: 26px; }
.auth-head h1 { font-size: 24px; letter-spacing: -.02em; }
.auth-head p { font-size: 13.5px; color: var(--text-2); margin-top: 6px; }
.auth-card .btn-block { margin-top: 6px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--text-2); margin-top: 22px; }

/* ---------- 落地页 ---------- */
.blank-body { background: #fbfcff; }
.landing { max-width: 1120px; margin: 0 auto; padding: 26px 28px 40px; }
.landing-nav { display: flex; align-items: center; justify-content: space-between; padding-bottom: 40px; }
.landing-nav-actions { display: flex; gap: 10px; }

.landing-hero {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 48px;
    align-items: center;
    padding: 30px 0 64px;
}
.pill {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--brand-weak);
    color: var(--brand);
    font-size: 11.5px;
    font-weight: 500;
    margin-bottom: 18px;
}
.landing-copy h1 { font-size: 44px; line-height: 1.22; letter-spacing: -.035em; }
.landing-copy h1 em { font-style: normal; background: linear-gradient(100deg, #2b5cff, #7c3aed); -webkit-background-clip: text; background-clip: text; color: transparent; }
.landing-copy > p { font-size: 15px; color: var(--text-2); line-height: 1.85; margin: 18px 0 28px; max-width: 460px; }
.landing-cta { display: flex; gap: 12px; }

.landing-art { display: flex; justify-content: center; }
.art-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 30px 60px -30px rgba(30, 45, 100, .28);
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.art-node {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}
.art-node .icon { width: 20px; height: 20px; }
.art-node strong { display: block; font-size: 12.5px; }
.art-node small { font-size: 11px; color: var(--text-3); }
.art-trigger { border-left: 3px solid var(--brand); color: var(--brand); }
.art-cond { border-left: 3px solid var(--warn); color: var(--warn); }
.art-action { border-left: 3px solid var(--ok); color: var(--ok); }
.art-ai { border-left: 3px solid var(--purple); color: var(--purple); }
.art-trigger strong, .art-cond strong, .art-action strong, .art-ai strong { color: var(--text); }
.art-line { width: 2px; height: 18px; background: var(--border-strong); margin-left: 24px; }
.art-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.art-branch { display: flex; flex-direction: column; }

.landing-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding: 40px 0 60px; border-top: 1px solid var(--border); }
.feature .icon { width: 22px; height: 22px; color: var(--brand); }
.feature h3 { font-size: 14.5px; margin: 12px 0 6px; }
.feature p { font-size: 13px; color: var(--text-2); line-height: 1.75; }
.landing-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); padding-top: 24px; border-top: 1px solid var(--border); }

/* ---------- 404 ---------- */
.notfound { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.notfound-code { font-size: 72px; font-weight: 700; letter-spacing: -.05em; color: var(--border-strong); line-height: 1; }
.notfound h1 { font-size: 20px; }
.notfound p { font-size: 13.5px; color: var(--text-2); margin-bottom: 12px; }

/* ==========================================================================
   流程编辑器
   ========================================================================== */
.editor-body { background: var(--surface); overflow: hidden; }

.ed-top {
    height: 56px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: relative;
    z-index: 30;
}
.ed-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ed-title { display: flex; align-items: center; gap: 9px; }
.ed-title strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.ed-center { flex: 1; text-align: center; }
.save-state { font-size: 12px; color: var(--text-3); }
.save-state.is-dirty { color: var(--warn); }
.save-state.is-saved { color: var(--ok); }
.ed-right { display: flex; gap: 8px; align-items: center; }

.ed-shell {
    display: flex;
    height: calc(100vh - 56px);
    overflow: hidden;
}

/* 积木库 */
.ed-palette {
    width: 262px;
    flex: none;
    border-right: 1px solid var(--border);
    background: var(--surface-2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.palette-head { padding: 16px 16px 10px; }
.palette-head h2 { font-size: 13px; }
.palette-head p { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.palette-search { position: relative; padding: 0 16px 10px; }
.palette-search .icon { position: absolute; left: 26px; top: 8px; width: 15px; height: 15px; color: var(--text-3); }
.palette-search input {
    width: 100%;
    height: 32px;
    padding: 0 10px 0 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    font-size: 12.5px;
    font-family: inherit;
    color: var(--text);
}
.palette-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }

.palette-body { flex: 1; overflow-y: auto; padding: 0 12px 12px; }
.palette-group { margin-bottom: 6px; }
.palette-group h3 {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-3);
    padding: 12px 6px 6px;
    display: flex;
    flex-direction: column;
}
.palette-group h3 small { display: none; font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 10px; color: var(--text-3); }

.palette-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    width: 100%;
    padding: 8px 9px;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    text-align: left;
    cursor: grab;
    transition: background .14s, border-color .14s;
}
.palette-item:hover { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-xs); }
.palette-item:active { cursor: grabbing; }
.palette-icon {
    width: 26px; height: 26px; flex: none;
    display: grid; place-items: center;
    border-radius: 7px;
    background: color-mix(in srgb, var(--node-color) 12%, white);
    color: var(--node-color);
}
.palette-icon .icon { width: 15px; height: 15px; }
.palette-text { min-width: 0; line-height: 1.35; }
.palette-text strong { display: block; font-size: 12.5px; }
.palette-text small { font-size: 10.5px; color: var(--text-3); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.palette-foot { padding: 10px 14px; border-top: 1px solid var(--border); }

/* 画布 */
.ed-canvas-wrap {
    flex: 1;
    position: relative;
    overflow: auto;
    background-color: #f8f9fd;
    background-image: radial-gradient(circle, #d9dce9 1px, transparent 1px);
    background-size: 20px 20px;
}
.ed-canvas {
    position: relative;
    width: 2400px;
    height: 1600px;
    transform-origin: 0 0;
}
.ed-edges {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    color: var(--border-strong);
    pointer-events: none;
}
.ed-edges path.wire { fill: none; stroke: #b9bfd4; stroke-width: 2; pointer-events: stroke; }
.ed-edges path.wire.is-hot { stroke: var(--brand); }
.ed-edges path.wire-true { stroke: #e2ab5c; }
.ed-edges path.wire-false { stroke: #b9bfd4; }
.ed-edges path.draft { fill: none; stroke: var(--brand); stroke-width: 2; stroke-dasharray: 5 4; }
.ed-edges path.hit { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; cursor: pointer; }
.ed-edges path.hit:hover + path.wire,
.ed-edges g:hover path.wire { stroke: var(--brand); }

.ed-nodes { position: absolute; inset: 0; }

/* 节点 */
.node {
    position: absolute;
    width: 216px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 13px;
    box-shadow: var(--shadow-sm);
    cursor: grab;
    user-select: none;
    transition: box-shadow .16s, border-color .16s;
}
.node:hover { box-shadow: var(--shadow); }
.node.is-selected { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring), var(--shadow); }
.node.is-dragging { cursor: grabbing; box-shadow: 0 18px 40px -16px rgba(20, 30, 70, .35); z-index: 10; }

.node-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
.node-icon {
    width: 24px; height: 24px; flex: none;
    display: grid; place-items: center;
    border-radius: 7px;
    background: color-mix(in srgb, var(--node-color) 12%, white);
    color: var(--node-color);
}
.node-icon .icon { width: 14px; height: 14px; }
.node-title { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-del {
    width: 20px; height: 20px;
    display: grid; place-items: center;
    border: none; background: transparent;
    border-radius: 5px;
    color: var(--text-3);
    cursor: pointer;
    opacity: 0;
    transition: opacity .14s, background .14s;
}
.node:hover .node-del { opacity: 1; }
.node-del:hover { background: var(--bad-weak); color: var(--bad); }
.node-del .icon { width: 12px; height: 12px; }

.node-body { padding: 9px 12px 11px; }
.node-desc { font-size: 11.5px; color: var(--text-3); line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.node-preview {
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--text-2);
    background: var(--surface-2);
    border-radius: 6px;
    padding: 5px 7px;
    font-family: var(--mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 端口 */
.port {
    position: absolute;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid #b9bfd4;
    cursor: crosshair;
    transition: transform .12s, border-color .12s, background .12s;
}
.port:hover { transform: scale(1.25); border-color: var(--brand); background: var(--brand-weak); }
.port-in { left: -7px; top: 50%; margin-top: -6.5px; }
.port-out { right: -7px; }
.port-out.is-true { border-color: #e2ab5c; }
.port-out.is-false { border-color: #b9bfd4; }
.port-label {
    position: absolute;
    right: 10px;
    font-size: 9.5px;
    color: var(--text-3);
    background: var(--surface);
    padding: 0 3px;
    pointer-events: none;
    white-space: nowrap;
}

/* 画布浮层 */
.ed-tip {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    background: rgba(23, 26, 38, .84);
    color: #fff;
    font-size: 11.5px;
    padding: 7px 14px;
    border-radius: 999px;
    pointer-events: none;
    backdrop-filter: blur(6px);
    z-index: 15;
}
.ed-zoom {
    position: fixed;
    right: 306px;
    bottom: 16px;
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 3px;
    box-shadow: var(--shadow-sm);
    z-index: 15;
}
.ed-zoom span { font-size: 11px; color: var(--text-2); min-width: 38px; text-align: center; }

/* 属性面板 */
.ed-inspector {
    width: 292px;
    flex: none;
    border-left: 1px solid var(--border);
    background: var(--surface);
    overflow-y: auto;
}
.inspector-empty {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-3);
    font-size: 12.5px;
    text-align: center;
    padding: 30px;
}
.inspector-empty .icon { width: 26px; height: 26px; color: var(--border-strong); }

.inspector-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.insp-head { display: flex; align-items: center; gap: 9px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.insp-head h3 { font-size: 13.5px; }
.insp-head small { display: block; font-size: 11px; color: var(--text-3); }
.insp-fields { display: flex; flex-direction: column; gap: 13px; }
.insp-fields .field > label { font-size: 11.5px; }
.insp-fields .hint { font-size: 11px; }

/* 抽屉 */
.ed-drawer {
    position: fixed;
    right: 0;
    top: 56px;
    bottom: 0;
    width: 380px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: -20px 0 50px -30px rgba(20, 30, 70, .3);
    z-index: 40;
    display: flex;
    flex-direction: column;
    animation: slideIn .2s ease;
}
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 14px; }
.drawer-body { flex: 1; overflow-y: auto; }
.drawer-form { padding: 16px; display: flex; flex-direction: column; gap: 14px; border-bottom: 1px solid var(--border); }
.drawer-result { padding: 16px; }
.drawer-hint { font-size: 12.5px; color: var(--text-3); line-height: 1.8; }

.trace { display: flex; flex-direction: column; gap: 0; }
.trace-item { display: flex; gap: 10px; padding-bottom: 14px; position: relative; }
.trace-item::before {
    content: "";
    position: absolute;
    left: 7px; top: 18px; bottom: 0;
    width: 1.5px;
    background: var(--border);
}
.trace-item:last-child::before { display: none; }
.trace-dot {
    width: 15px; height: 15px; flex: none;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    background: var(--surface);
    margin-top: 3px;
    z-index: 1;
}
.trace-item.is-ok .trace-dot { border-color: var(--ok); background: var(--ok-weak); }
.trace-item.is-bad .trace-dot { border-color: var(--bad); background: var(--bad-weak); }
.trace-body strong { display: block; font-size: 12.5px; }
.trace-body small { font-size: 11.5px; color: var(--text-2); }

.outbox-item {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 9px 11px;
    margin-bottom: 8px;
}
.outbox-item .tag { font-size: 10px; color: var(--brand); background: var(--brand-weak); padding: 1px 6px; border-radius: 4px; }
.outbox-item p { font-size: 12.5px; margin-top: 5px; white-space: pre-wrap; word-break: break-word; }

/* 弹窗 */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(20, 24, 40, .38);
    backdrop-filter: blur(3px);
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 20px;
}
.modal-card {
    width: 100%;
    max-width: 460px;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 30px 70px -30px rgba(20, 30, 70, .5);
    overflow: hidden;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 14.5px; }
.modal-body { padding: 18px; }
.template-list { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.template-item {
    text-align: left;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.template-item:hover { border-color: var(--brand); background: var(--brand-weak); }
.template-item strong { display: block; font-size: 13px; }
.template-item small { font-size: 11.5px; color: var(--text-2); }

/* toast */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
    background: #171a26;
    color: #fff;
    font-size: 12.5px;
    padding: 9px 16px;
    border-radius: 999px;
    box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .5);
    animation: toastIn .22s ease;
}
.toast.is-error { background: var(--bad); }
.toast.is-ok { background: #0d8a4f; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
    .grid-2, .grid-form { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .landing-hero { grid-template-columns: 1fr; gap: 32px; }
    .landing-copy h1 { font-size: 34px; }
}

@media (max-width: 900px) {
    .webhook-url code { font-size: 12.5px; min-width: 100%; }
    .webhook-url .btn { margin-left: 0; width: 100%; }
    .sidebar {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: 0 0 60px rgba(20, 30, 70, .18);
    }
    .sidebar.is-open { transform: none; }
    .only-mobile { display: inline-flex; }
    .content { padding: 18px 16px 60px; }
    .topbar { padding: 0 16px; }
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .landing-features { grid-template-columns: 1fr; }
    .ed-palette, .ed-inspector { display: none; }
    .ed-zoom { right: 16px; }
    .ed-drawer { width: 100%; }
}

/* ==========================================================================
   主文件编辑器（code studio）
   ========================================================================== */

.cs-body { background: var(--surface); overflow: hidden; }

.cs-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

/* ---------------- 顶部工具栏 ---------------- */

.cs-top {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    flex: none;
    padding: 0 14px 0 10px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.cs-title {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.cs-title strong {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.cs-file {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--surface-3);
    color: var(--text-2);
    font-family: var(--mono);
    font-size: 11.5px;
}

.cs-file .icon { width: 13px; height: 13px; }

.cs-state {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-3);
    white-space: nowrap;
    transition: color .15s;
}

.cs-state.is-ok { color: var(--ok); }
.cs-state.is-warn { color: var(--warn); }
.cs-state.is-bad { color: var(--bad); }

.cs-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.cs-actions kbd {
    margin-left: 4px;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .22);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .3px;
}

.cs-upload { position: relative; cursor: pointer; }

/* ---------------- 主体 ---------------- */

.cs-body-grid {
    display: flex;
    flex: 1;
    min-height: 0;
}

.cs-editor {
    position: relative;
    display: flex;
    flex: 1;
    min-width: 0;
    background: #1b1e2b;
    overflow: hidden;
}

.cs-editor.is-drop::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 2px dashed rgba(120, 160, 255, .7);
    border-radius: 12px;
    background: rgba(43, 92, 255, .08);
    pointer-events: none;
}

.cs-drop-hint {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(43, 92, 255, .92);
    color: #fff;
    font-size: 13px;
    pointer-events: none;
}

.cs-editor.is-drop .cs-drop-hint { display: flex; }

.cs-gutter {
    flex: none;
    width: 58px;
    padding: 16px 0 40px;
    overflow: hidden;
    text-align: right;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 24px;
    color: #4d5470;
    background: #171a25;
    border-right: 1px solid #262a3a;
    user-select: none;
}

.cs-gutter span {
    display: block;
    padding-right: 12px;
}

.cs-gutter span.is-cur {
    color: #aab3d4;
    background: rgba(255, 255, 255, .04);
}

.cs-input {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 16px 20px 40px 14px;
    border: 0;
    outline: 0;
    resize: none;
    background: transparent;
    color: #dfe4f5;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 24px;
    tab-size: 4;
    white-space: pre;
    overflow: auto;
    caret-color: #7ba2ff;
}

.cs-input::placeholder { color: #4a5069; }

.cs-input::selection { background: rgba(96, 140, 255, .35); }

.cs-input::-webkit-scrollbar { width: 12px; height: 12px; }
.cs-input::-webkit-scrollbar-thumb {
    background: #333a4f;
    border-radius: 6px;
    border: 3px solid #1b1e2b;
}
.cs-input::-webkit-scrollbar-thumb:hover { background: #414a64; }

/* ---------------- 右侧面板 ---------------- */

.cs-side {
    flex: none;
    width: 372px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-left: 1px solid var(--border);
    background: var(--surface);
}

.cs-tabs {
    display: flex;
    flex: none;
    gap: 2px;
    padding: 8px 10px 0;
    border-bottom: 1px solid var(--border);
}

.cs-tab {
    padding: 7px 12px 9px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--text-3);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: color .14s, border-color .14s;
}

.cs-tab:hover { color: var(--text-2); }

.cs-tab.is-active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

.cs-pane {
    display: none;
    flex: 1;
    min-height: 0;
    padding: 14px 16px 24px;
    overflow-y: auto;
}

.cs-pane.is-active { display: block; }

.cs-hint {
    margin: 0 0 12px;
    font-size: 12.5px;
    line-height: 1.75;
    color: var(--text-2);
}

.cs-hint b { color: var(--text); }

.cs-divider {
    height: 1px;
    margin: 16px 0;
    background: var(--border);
}

/* 试跑 */

.cs-run-form {
    display: flex;
    gap: 8px;
}

.cs-run-form .input { flex: 1; height: 34px; font-size: 13px; }

.cs-run-result {
    margin-top: 12px;
    padding: 12px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    font-size: 12.5px;
    line-height: 1.7;
}

.cs-run-result.is-ok { border-color: #c8ecd8; background: var(--ok-weak); }
.cs-run-result.is-error { border-color: #f6d5d5; background: var(--bad-weak); }

.cs-run-result > strong {
    display: block;
    margin-bottom: 6px;
    font-size: 12.5px;
    color: var(--text);
}

.cs-run-sent {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cs-run-sent li {
    display: flex;
    gap: 8px;
    padding: 6px 0;
    border-top: 1px dashed rgba(23, 26, 38, .08);
    word-break: break-word;
    white-space: pre-wrap;
}

.cs-run-sent li:first-child { border-top: 0; }

.cs-run-type {
    flex: none;
    height: 18px;
    padding: 0 6px;
    border-radius: 4px;
    background: rgba(43, 92, 255, .12);
    color: var(--brand);
    font-family: var(--mono);
    font-size: 10.5px;
    line-height: 18px;
}

.cs-run-err ul { margin: 4px 0 0; padding-left: 18px; }
.cs-run-err li { margin: 3px 0; color: #a82323; word-break: break-word; }

.cs-run-out {
    margin: 6px 0 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(23, 26, 38, .05);
    font-family: var(--mono);
    font-size: 11.5px;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow: auto;
}

.cs-run-none { margin: 0; color: var(--text-2); }

/* 元信息 */

.cs-meta {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 12px;
}

.cs-meta div { display: flex; justify-content: space-between; }
.cs-meta span { color: var(--text-3); }
.cs-meta b { font-weight: 500; color: var(--text-2); font-family: var(--mono); font-size: 11.5px; }

.cs-mini-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 14px;
}

.cs-mini-actions form { display: contents; }

/* 变量速查 */

.cs-ref {
    margin: 0 0 14px;
    font-size: 12.5px;
}

.cs-ref dt { margin-top: 8px; }
.cs-ref dt:first-child { margin-top: 0; }

.cs-ref dt code {
    padding: 1px 6px;
    border-radius: 5px;
    background: var(--surface-3);
    color: #9a3412;
    font-family: var(--mono);
    font-size: 11.5px;
}

.cs-ref dd {
    margin: 2px 0 0 0;
    color: var(--text-2);
    line-height: 1.65;
}

.cs-ref dd code {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-3);
}

.cs-h4 {
    margin: 16px 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-3);
    letter-spacing: .4px;
}

.cs-api { display: flex; flex-direction: column; gap: 2px; }

.cs-api-row {
    display: flex;
    align-items: baseline;
    gap: 9px;
    width: 100%;
    padding: 6px 8px;
    border: 0;
    border-radius: 7px;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: background .13s;
}

.cs-api-row:hover { background: var(--brand-weak); }

.cs-api-row code {
    flex: none;
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--brand);
}

.cs-api-row span {
    font-size: 11.5px;
    color: var(--text-3);
}

.cs-ref-block { margin-top: 4px; }

.cs-code {
    margin: 0;
    padding: 10px 12px;
    border-radius: 9px;
    background: #1b1e2b;
    color: #c4cbe4;
    font-family: var(--mono);
    font-size: 11.5px;
    line-height: 1.85;
    overflow-x: auto;
    white-space: pre;
}

/* 片段 */

.cs-snippets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.cs-snippet {
    padding: 10px 11px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text-2);
    font-family: inherit;
    font-size: 12px;
    text-align: left;
    line-height: 1.5;
    cursor: pointer;
    transition: all .14s;
    box-shadow: var(--shadow-xs);
}

.cs-snippet:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-weak);
    transform: translateY(-1px);
}

.cs-tip {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding: 9px 11px;
    border-radius: 9px;
    background: var(--warn-weak);
    color: var(--text-2);
    font-size: 11.5px;
    line-height: 1.65;
}

.cs-tip .icon { flex: none; color: var(--warn); margin-top: 2px; }
.cs-tip code { font-family: var(--mono); font-size: 11px; }

/* ---------------- 底部 ---------------- */

.cs-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: none;
    height: 34px;
    padding: 0 16px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 11.5px;
    color: var(--text-3);
    overflow: hidden;
}

.cs-foot code {
    font-family: var(--mono);
    color: var(--text-2);
}

.cs-foot-right { flex: none; }

/* ---------------- toast ---------------- */

.cs-toast {
    position: fixed;
    left: 50%;
    bottom: 56px;
    transform: translate(-50%, 12px);
    padding: 9px 18px;
    border-radius: 10px;
    background: #22283a;
    color: #fff;
    font-size: 12.5px;
    box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .5);
    opacity: 0;
    transition: opacity .2s, transform .2s;
    pointer-events: none;
    z-index: 90;
}

.cs-toast.is-show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.cs-toast.is-error { background: #b3261e; }

/* ---------------- 窄屏 ---------------- */

@media (max-width: 1080px) {
    .cs-side { width: 320px; }
    .cs-title strong { max-width: 130px; }
}

@media (max-width: 860px) {
    .cs-body-grid { flex-direction: column; }
    .cs-editor { min-height: 46vh; }
    .cs-side {
        width: auto;
        border-left: 0;
        border-top: 1px solid var(--border);
        max-height: 46vh;
    }
    .cs-state { display: none; }
    .cs-foot { display: none; }
    .cs-actions kbd { display: none; }
}

/* ==========================================================================
   机器人运行方式选择卡
   ========================================================================== */

.mode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.mode-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    transition: border-color .16s, box-shadow .16s;
}

.mode-card.is-active {
    border-color: #c3d2ff;
    box-shadow: 0 0 0 3px rgba(43, 92, 255, .07), var(--shadow-sm);
}

.mode-card header {
    display: flex;
    align-items: flex-start;
    gap: 11px;
}

.mode-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--brand-weak);
    color: var(--brand);
}

.mode-icon.is-flow {
    background: var(--purple-weak);
    color: var(--purple);
}

.mode-icon .icon { width: 19px; height: 19px; }

.mode-card header > div { min-width: 0; flex: 1; }

.mode-card h3 {
    margin: 0;
    font-size: 14.5px;
    font-weight: 600;
}

.mode-card header p {
    margin: 3px 0 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-3);
}

.mode-flag {
    flex: none;
    height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    line-height: 20px;
    font-weight: 500;
}

.mode-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 9px;
    background: var(--surface-2);
    font-size: 11.5px;
    color: var(--text-3);
    font-family: var(--mono);
}

.mode-meta.is-empty {
    font-family: var(--font);
    color: var(--warn);
    background: var(--warn-weak);
}

.mode-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}

.mode-actions form { display: contents; }

@media (max-width: 720px) {
    .mode-grid { grid-template-columns: 1fr; }
}

/* 单选卡片（创建机器人时选运行方式） */
.pick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.pick {
    position: relative;
    cursor: pointer;
}

.pick input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pick-body {
    display: block;
    padding: 11px 13px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--surface);
    transition: border-color .15s, background .15s, box-shadow .15s;
}

.pick-body strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.pick-body small {
    display: block;
    margin-top: 2px;
    font-size: 11.5px;
    line-height: 1.55;
    color: var(--text-3);
}

.pick:hover .pick-body { border-color: #b9c4e4; }

.pick input:checked + .pick-body {
    border-color: var(--brand);
    background: var(--brand-weak);
    box-shadow: 0 0 0 3px var(--brand-ring);
}

.pick input:checked + .pick-body strong { color: var(--brand); }

@media (max-width: 560px) {
    .pick-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   云湖 OAuth 登录 & 账号页
   ========================================================================== */

/* 登录页：分隔线 + 第三方按钮 */
.auth-or {
    position: relative;
    margin: 20px 0 16px;
    text-align: center;
}

.auth-or::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--border);
}

.auth-or span {
    position: relative;
    padding: 0 12px;
    background: var(--surface);
    color: var(--text-3);
    font-size: 12px;
}

.btn-oauth {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 42px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    box-shadow: var(--shadow-xs);
    transition: border-color .15s, background .15s, transform .1s;
}

.btn-oauth:hover {
    border-color: var(--brand);
    background: var(--brand-weak);
    color: var(--brand);
}

.btn-oauth:active { transform: translateY(1px); }

.btn-oauth .yh-logo {
    width: 20px;
    height: 20px;
    flex: none;
}

.auth-hint {
    margin: 10px 0 0;
    text-align: center;
    font-size: 12px;
    color: var(--text-3);
}

/* 账号页 */
.avatar-lg {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    font-size: 17px;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.account-head {
    display: flex;
    align-items: center;
    gap: 13px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.account-head strong {
    display: block;
    font-size: 14.5px;
    font-weight: 600;
}

.account-head small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-3);
}

.bind-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 13px;
    margin-bottom: 14px;
    border-radius: 10px;
    background: var(--surface-2);
}

.bind-row strong {
    display: block;
    font-size: 13.5px;
}

.bind-row small {
    display: block;
    margin-top: 2px;
    font-size: 11.5px;
    color: var(--text-3);
    font-family: var(--mono);
}

.copy-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    background: var(--surface-2);
}

.copy-row code {
    flex: 1;
    min-width: 0;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-2);
    word-break: break-all;
    user-select: all;
}

/* 侧栏用户区可点进账号设置 */
.user-link {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
    border-radius: 9px;
    padding: 4px;
    margin: -4px;
    transition: background .14s;
}

.user-link:hover { background: var(--surface-2); }

/* ==========================================================================
   积木编辑器：接续按钮、连线提示、空画布引导
   ========================================================================== */

/* 节点右下角的「＋」：点一下直接接下一个积木 */
.node-plus {
    position: absolute;
    right: -13px;
    bottom: -13px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-3);
    font-size: 17px;
    line-height: 1;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    transform: scale(.8);
    box-shadow: var(--shadow-sm);
    transition: opacity .14s, transform .14s, background .14s, color .14s, border-color .14s;
    z-index: 3;
}

.node:hover .node-plus,
.node.is-selected .node-plus {
    opacity: 1;
    transform: scale(1);
}

.node-plus:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    transform: scale(1.1);
}

/* 刚加进来的积木闪一下 */
@keyframes nodeFresh {
    0%   { box-shadow: 0 0 0 0 rgba(43, 92, 255, .45); }
    70%  { box-shadow: 0 0 0 10px rgba(43, 92, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(43, 92, 255, 0); }
}

.node.is-fresh {
    border-color: var(--brand);
    animation: nodeFresh .9s ease-out 2;
}

/* 拖线时，鼠标下的目标节点高亮 */
.node.is-link-target {
    border-color: var(--ok);
    box-shadow: 0 0 0 3px rgba(15, 157, 88, .18), var(--shadow);
}

.node.is-link-target::after {
    content: "";
    position: absolute;
    inset: -3px;
    border: 2px dashed rgba(15, 157, 88, .55);
    border-radius: 15px;
    pointer-events: none;
}

/* 端口点击热区放大（视觉不变，好按很多） */
.port::before {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
}

/* 「接一个积木」弹层 */
.next-menu {
    position: fixed;
    z-index: 200;
    width: 208px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 18px 40px -14px rgba(21, 26, 45, .35);
    animation: nextIn .14s ease-out;
}

@keyframes nextIn {
    from { opacity: 0; transform: translateY(-4px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

.next-head {
    padding: 3px 7px 8px;
    font-size: 11.5px;
    color: var(--text-3);
}

.next-ports {
    display: flex;
    gap: 6px;
    padding: 0 5px 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}

.next-ports button {
    flex: 1;
    height: 26px;
    border: 1px solid var(--border-strong);
    border-radius: 7px;
    background: var(--surface);
    color: var(--text-3);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: all .13s;
}

.next-ports button.is-on {
    border-color: var(--brand);
    background: var(--brand-weak);
    color: var(--brand);
    font-weight: 500;
}

.next-list { display: flex; flex-direction: column; gap: 1px; }

.next-list button {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 9px;
    border: 0;
    border-radius: 7px;
    background: none;
    color: var(--text-2);
    font-family: inherit;
    font-size: 12.5px;
    text-align: left;
    cursor: pointer;
    transition: background .12s, color .12s;
}

.next-list button:hover {
    background: var(--brand-weak);
    color: var(--brand);
}

.next-list .icon {
    width: 15px;
    height: 15px;
    flex: none;
    color: var(--text-3);
}

.next-list button:hover .icon { color: var(--brand); }

/* 空画布引导 */
.ed-canvas-wrap.is-empty::before {
    content: "从左边点一个积木开始，或者点「载入模板」";
    position: absolute;
    left: 50%;
    top: 46%;
    transform: translate(-50%, -50%);
    padding: 16px 26px;
    border: 1px dashed var(--border-strong);
    border-radius: 14px;
    background: rgba(255, 255, 255, .74);
    color: var(--text-3);
    font-size: 13.5px;
    pointer-events: none;
    z-index: 2;
}

/* 检查器底部的危险操作区 */
.insp-foot {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.insp-foot .btn-danger {
    justify-content: center;
}

.insp-foot-hint {
    text-align: center;
    font-size: 11px;
    color: var(--text-3);
}

/* 选中的积木常驻显示删除按钮，不用靠 hover 猜 */
.node.is-selected .node-del { opacity: .75; }

/* ==========================================================================
   控制台：趋势图 / 快捷操作 / 活跃排行
   ========================================================================== */

.chart-card { margin-bottom: 18px; }

.chart-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: var(--text-3);
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.lg {
    width: 9px;
    height: 9px;
    border-radius: 3px;
    display: inline-block;
}

.lg-in { background: var(--brand); }
.lg-out { background: #9fb6ff; }

.chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 168px;
    padding: 6px 4px 0;
}

.chart-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    height: 100%;
}

.chart-bar {
    width: 100%;
    max-width: 46px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 2px;
    border-radius: 6px;
    background: var(--surface-3);
    overflow: hidden;
    transition: background .15s;
}

.chart-col:hover .chart-bar { background: #e9edf7; }

.bar-seg {
    display: block;
    width: 100%;
    border-radius: 4px 4px 0 0;
    transition: opacity .15s;
}

.bar-in { background: var(--brand); }
.bar-out { background: #9fb6ff; }

.chart-col:hover .bar-seg { opacity: .82; }

.chart-total {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
    min-height: 15px;
}

.chart-label {
    font-size: 11px;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}

/* 快捷操作 */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.quick {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 11px 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 11.5px;
    text-align: center;
    text-decoration: none;
    transition: all .14s;
}

.quick:hover {
    border-color: var(--brand);
    background: var(--brand-weak);
    color: var(--brand);
}

.quick .icon { width: 17px; height: 17px; }

/* 活跃排行 */
.rank-list { display: flex; flex-direction: column; }

.rank-list li + li { border-top: 1px solid var(--border); }

.rank-list a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 4px;
    color: inherit;
    text-decoration: none;
}

.rank-list a:hover { background: var(--surface-2); }

.rank-no {
    flex: none;
    width: 21px;
    height: 21px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: var(--surface-3);
    color: var(--text-3);
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.rank-no-1 { background: #fff3d6; color: #a36900; }
.rank-no-2 { background: #eef1f7; color: #6b7488; }
.rank-no-3 { background: #fbeade; color: #a2592a; }

.rank-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rank-name {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-bar {
    height: 4px;
    border-radius: 3px;
    background: var(--surface-3);
    overflow: hidden;
}

.rank-bar i {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #6f92ff, var(--brand));
}

.rank-num {
    flex: none;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}

/* 全局日志的搜索条 */
.log-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.log-search .input {
    height: 34px;
    font-size: 12.5px;
}

.log-search select.input { width: 148px; }
.log-search input[type="search"].input { width: 168px; }

@media (max-width: 900px) {
    .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .chart { height: 140px; }
    .log-search { flex-wrap: wrap; }
    .log-search select.input,
    .log-search input[type="search"].input { width: auto; flex: 1; min-width: 120px; }
}
