/* ai-blog 后台样式 —— 版式与配色参照 Dashboard-UI / go-webui（BackupMesh Web UI 同款）。
   颜色只写浅色值：暗黑模式靠整页反色（见 html[data-theme=dark]），不维护第二套颜色。 */
*{box-sizing:border-box;margin:0;padding:0}
button,input,select,textarea{font-family:inherit;font-size:100%;line-height:inherit;color:inherit}
button{background:none;border:0}
img,svg{display:block;max-width:100%}
ul,ol{list-style:none}
:root{--blue:#1677ff;--blue-h:#0e5fd8;--blue-bg:#eff6ff;--text:#1f2937;--muted:#6b7280;--faint:#9ca3af;--bg:#f0f2f5;--line:#e5e7eb;--line2:#f3f4f6}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'PingFang SC','Microsoft YaHei',sans-serif;background:var(--bg);color:var(--text);font-size:14px;line-height:1.55;overscroll-behavior:none}
a{color:var(--blue);text-decoration:none}
code{background:#f0f2f5;padding:1px 5px;border-radius:3px;font-size:.92em}
small{color:var(--muted);font-weight:normal;font-size:12px}
[hidden]{display:none!important}

/* ── 图标 ── */
.ic{width:16px;height:16px;flex-shrink:0;display:inline-block;vertical-align:-3px}
.ic-sprite{position:absolute;width:0;height:0;overflow:hidden}

/* ── 框架：左侧栏 + 顶栏 + 内容区 ── */
/* 侧栏固定 200px：把偏移放在 body 上，内容区就能用 auto 边距在剩余宽度里居中 */
body:not(.login-page){padding-left:200px}
.sidebar{width:200px;background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;height:100vh;flex-shrink:0;position:fixed;left:0;top:0;z-index:60}
.sidebar-logo{padding:14px 18px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:10px}
.logo-icon{width:32px;height:32px;background:var(--blue);border-radius:7px;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;font-size:1rem;flex-shrink:0;overflow:hidden}
.logo-icon img{width:100%;height:100%;object-fit:cover;border-radius:7px}
.sidebar-logo .title{font-weight:700;font-size:.95rem;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:132px}
.sidebar-logo .sub{font-size:.7rem;color:var(--faint)}
.sidebar-nav{flex:1;padding:8px;overflow-y:auto}
.nav-group{font-size:.7rem;color:var(--faint);padding:12px 12px 4px;letter-spacing:.04em}
.nav-item{display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:8px;cursor:pointer;color:var(--muted);font-size:.875rem;transition:background .15s,color .15s;user-select:none;border:none;background:none;font-family:inherit;width:100%;text-align:left;white-space:nowrap}
.nav-item:hover{background:#f3f4f6;color:#111827}
.nav-item.active{background:var(--blue-bg);color:var(--blue);font-weight:500}
.nav-icon{width:18px;height:18px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.nav-icon .ic{width:18px;height:18px}
.nav-badge{margin-left:auto;background:#e5e7eb;color:var(--muted);font-size:.7rem;padding:1px 7px;border-radius:999px;font-weight:500}
.nav-badge.alert{background:#fee2e2;color:#dc2626}
.sidebar-footer{padding:8px 12px;border-top:1px solid var(--line);display:flex;justify-content:space-between;align-items:center}
.sidebar-backdrop{display:none;position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:59}
.icon-btn{width:34px;height:34px;border:0;background:transparent;border-radius:8px;cursor:pointer;color:var(--muted);display:inline-flex;align-items:center;justify-content:center;transition:background .15s,color .15s}
.icon-btn:hover{background:#f3f4f6;color:var(--blue)}
.icon-btn .ic{width:18px;height:18px}

.topbar{background:#fff;border-bottom:1px solid var(--line);padding:0 20px;height:52px;display:flex;align-items:center;justify-content:space-between;flex-shrink:0;gap:12px;position:sticky;top:0;z-index:30}
.topbar-left{display:flex;align-items:center;gap:8px;min-width:0}
.breadcrumb{font-size:.82rem;color:var(--faint);display:flex;align-items:center;gap:6px;min-width:0}
.breadcrumb b{color:#374151;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.topbar-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
.topbar-actions .write-btn{display:none} /* 手机上才出现（桌面端侧栏已有「写文章」） */
.hamburger{display:none;cursor:pointer;padding:6px;color:#374151;align-items:center;justify-content:center;border-radius:7px}
.hamburger:hover{background:#f3f4f6}
.hamburger .ic{width:22px;height:22px}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:7px;border:1px solid #d1d5db;background:#fff;color:#374151;cursor:pointer}
.theme-toggle:hover{background:#f3f4f6}
.theme-toggle .ic{width:17px;height:17px}
.theme-toggle .ic-sun{display:none}
html[data-theme="dark"] .theme-toggle .ic-moon{display:none}
html[data-theme="dark"] .theme-toggle .ic-sun{display:inline-block}

.amain{margin:0 auto;padding:22px 24px 44px;max-width:1160px}
.amain.narrow{max-width:920px}

/* ── 暗黑模式：整页反色 + hue-rotate 近似还原色相；图片 / 二维码反向补偿 ── */
html[data-theme="dark"]{filter:invert(1) hue-rotate(180deg) contrast(.85);background:#fff}
html[data-theme="dark"] img,html[data-theme="dark"] .qr,html[data-theme="dark"] [data-no-invert]{filter:contrast(1.1765) hue-rotate(180deg) invert(1)}

/* ── 按钮 ── */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:5px;height:34px;padding:0 14px;border-radius:7px;border:1px solid var(--line);background:#fff;color:var(--text);cursor:pointer;font-size:13.5px;font-weight:500;white-space:nowrap;font-family:inherit;transition:background .15s,border-color .15s,color .15s}
.btn:hover{border-color:#93c5fd;color:var(--blue)}
.btn.primary{background:var(--blue);border-color:var(--blue);color:#fff}
.btn.primary:hover{background:var(--blue-h);border-color:var(--blue-h);color:#fff}
.btn.primary.danger-bg{background:#dc2626;border-color:#dc2626}
.btn.primary.danger-bg:hover{background:#b91c1c;border-color:#b91c1c;color:#fff}
.btn.danger-line{color:#dc2626;border-color:#fca5a5}
.btn.danger-line:hover{color:#fff;background:#dc2626;border-color:#dc2626}
.btn:disabled{opacity:.5;cursor:not-allowed}
.btn .ic{width:15px;height:15px}
.btn-sm,.btn.sm{height:28px;padding:0 10px;font-size:12.5px}
.btn-sm .ic,.btn.sm .ic{width:14px;height:14px}
.linkbtn{background:none;border:none;color:var(--blue);cursor:pointer;font-size:inherit;font-family:inherit;padding:0;display:inline-flex;align-items:center;gap:3px;vertical-align:middle}
.linkbtn:hover{text-decoration:underline}
.linkbtn.danger{color:#dc2626}
.linkbtn .ic,.w-act .ic{width:14px;height:14px}
.form label.btn{display:inline-flex;flex-direction:row;align-self:flex-start;font-weight:normal;align-items:center;gap:5px;color:var(--text)}

/* ── 卡片 / 面板 ── */
.panel{background:#fff;border:1px solid var(--line);border-radius:10px;overflow:hidden;margin-bottom:16px}
.card-title,.section-title{display:flex;align-items:center;gap:8px;font-weight:600;color:#374151}

/* ── 表格 ── */
.tbl{width:100%;border-collapse:collapse}
.tbl th{background:#f9fafb;font-weight:600;color:var(--muted);font-size:12.5px;text-align:left;padding:10px 14px;border-bottom:1px solid var(--line);white-space:nowrap}
.tbl td{padding:10px 14px;font-size:13.5px;color:#374151;border-bottom:1px solid var(--line2);vertical-align:middle}
.tbl tr:last-child td{border-bottom:none}
.tbl th a.sort{color:inherit;display:inline-flex;align-items:center;gap:3px;cursor:pointer;user-select:none}
.tbl th a.sort:hover,.tbl th a.sort.on{color:var(--text)}
.tbl th a.sort::after{content:"↕";font-size:11px;opacity:0;transition:opacity .15s}
.tbl th a.sort:hover::after{opacity:.4}
.tbl th a.sort.on::after{opacity:1;color:var(--blue)}
.tbl th a.sort.on.asc::after{content:"↑"}
.tbl th a.sort.on.desc::after{content:"↓"}
.tbl tr:hover td{background:#fafafa}
.tbl .ttl{color:var(--text);font-weight:500}
.tbl .ttl:hover{color:var(--blue)}
.tbl .sub{font-size:12px;color:var(--faint);margin-top:2px;word-break:break-all}
.w-date{width:150px;color:var(--faint);white-space:nowrap}
.w-num{width:80px;color:var(--faint);white-space:nowrap}
.w-act{width:220px;white-space:nowrap;text-align:right}
.w-act a,.w-act button{margin-left:10px}
.files .w-act{width:300px}
/* 操作栏只放图标按钮，文字收进 title 悬停提示 */
.w-act.ic-acts,.files .w-act.ic-acts{width:1%}
.ic-acts>a,.ic-acts>button{display:inline-flex;align-items:center;justify-content:center;vertical-align:top;width:30px;height:30px;padding:0;margin-left:2px;border-radius:6px;color:var(--blue)}
.ic-acts>a:hover,.ic-acts>button:hover{background:var(--blue-bg);text-decoration:none}
.ic-acts>.danger{color:#dc2626}
.ic-acts>.danger:hover{background:#fef2f2}
.ic-acts>button:disabled{opacity:.5;cursor:default}
.ic-acts>*>span{display:none}
.ic-acts .ic{width:17px;height:17px}
.w-thumb{width:64px}
.w-thumb img{width:48px;height:48px;object-fit:cover;border-radius:6px}
.empty{text-align:center;color:var(--faint);padding:40px!important}
.tbl .cl{display:flex;flex-wrap:wrap;align-items:center;gap:2px}
.tbl .cl .badge{margin-left:2px}

/* ── 徽标 ── */
.badge{display:inline-flex;align-items:center;gap:4px;font-size:11.5px;font-weight:500;background:#f3f4f6;color:var(--muted);border-radius:999px;padding:1px 8px;margin-left:6px;vertical-align:middle;white-space:nowrap}
.badge.warn{background:#fffbeb;color:#b45309;border:0;padding:1px 8px;border-radius:999px;font-size:11.5px;line-height:inherit} /* 压过后面通用的 .warn 提示框样式 */
.badge.danger{background:#fef2f2;color:#dc2626}
.badge.ok{background:#f0fdf4;color:#16a34a}
.badge.ai{background:#f3effd;color:#6b3fd4}
.badge.cat{background:var(--blue-bg);color:var(--blue)}
.badge.pin{background:#fff1f0;color:#e5484d;margin-left:0;margin-right:4px}
.badge.pin .ic{width:12px;height:12px}
.pager{display:flex;justify-content:center;gap:16px;margin-top:16px;color:var(--muted);font-size:13px}
.pager a{color:var(--blue)}

/* ── 工具条 / 分段 / 搜索 ── */
.toolbar{display:flex;gap:10px;align-items:center;margin-bottom:14px;flex-wrap:wrap}
.seg{display:inline-flex;flex-wrap:wrap;gap:1px;background:#d1d5db;border:1px solid #d1d5db;border-radius:8px;overflow:hidden}
.seg a{flex:1 1 0;min-width:max-content;padding:6px 14px;font-size:13px;background:#fff;color:#374151;text-align:center;white-space:nowrap}
.seg a:hover{background:#f3f4f6}
.seg a.on{background:var(--blue);color:#fff}
.seg button{flex:1 1 0;min-width:max-content;display:inline-flex;align-items:center;justify-content:center;gap:5px;padding:6px 12px;font-size:13px;background:#fff;color:#374151;border:0;text-align:center;white-space:nowrap;cursor:pointer;transition:background .15s}
.seg button:hover:not(.on){background:#f3f4f6}
.seg button.on{background:var(--blue);color:#fff;font-weight:500}
.seg button .ic{width:15px;height:15px}
/* 设置页顶部标签栏：占满整行，窄屏自动换行 */
.seg.tabs{display:flex;width:100%;margin-bottom:16px}
.tab-panel>.panel:last-child{margin-bottom:0}
.toolbar .search{flex:1;min-width:180px;display:flex;gap:8px}
.toolbar .search input,.toolbar .search select{height:34px;border:1px solid #d1d5db;border-radius:7px;padding:0 11px;font-size:13.5px;outline:none;background:#fff;font-family:inherit;color:var(--text)}
.toolbar .search input{flex:1;width:100%}
.toolbar .search select{flex-shrink:0;max-width:45%}
.toolbar .search input:focus,.toolbar .search select:focus{border-color:var(--blue);box-shadow:0 0 0 2px rgba(22,119,255,.1)}
.trash-hint{flex:1;min-width:200px;font-size:12.5px;color:var(--muted)}

/* ── 表单 ── */
.form{padding:22px 24px;margin-bottom:16px;display:flex;flex-direction:column;gap:14px}
.form h2{font-size:16px;display:flex;align-items:center;gap:8px}
.form label{display:flex;flex-direction:column;gap:5px;font-weight:500;font-size:13px;color:var(--muted)}
.form label.check{flex-direction:row;align-items:center;gap:6px;font-weight:normal;color:var(--text)}
.form label.check input{width:15px;height:15px;accent-color:var(--blue)}
.form input:not([type=checkbox]):not([type=file]):not([type=radio]),.form textarea,.form select{border:1px solid #d1d5db;border-radius:7px;padding:8px 11px;font-size:14px;outline:none;font-family:inherit;font-weight:normal;width:100%;background:#fff;color:var(--text);transition:border-color .15s,box-shadow .15s}
.form input[type=file]{font-weight:normal}
.form textarea{resize:vertical;line-height:1.5}
.form .mono{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:13px}
.form input:focus,.form textarea:focus,.form select:focus{border-color:var(--blue);box-shadow:0 0 0 2px rgba(22,119,255,.1)}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.actions{display:flex;justify-content:flex-end;align-items:center;gap:12px;flex-wrap:wrap}
.inline-btns{margin-top:-6px}
.hint{color:var(--muted);font-size:13px;line-height:1.8}
.hint b{color:#374151}
.warn{background:#fffbeb;border:1px solid #fde68a;color:#92400e;border-radius:8px;padding:10px 14px;font-size:13px;line-height:1.8}
.save-state{font-size:13px;color:var(--faint)}
.save-state.ok{color:#16a34a}
.save-state.bad{color:#dc2626}
.error-text,.err{color:#dc2626;font-size:13px}
.avatar-row{display:flex;align-items:center;gap:12px}
.avatar-row img{width:56px;height:56px;border-radius:50%;object-fit:cover;border:1px solid var(--line)}
.ver{text-align:center;color:var(--faint);font-size:12px;margin-top:8px}

/* ── 登录 / 初始化 ── */
.login-page{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:16px;background:var(--bg)}
.login-box{background:#fff;border:1px solid var(--line);border-radius:12px;padding:32px 28px;width:100%;max-width:380px;display:flex;flex-direction:column;gap:14px;box-shadow:0 4px 24px rgba(0,0,0,.08)}
.login-box h1{font-size:20px;text-align:center;color:#111827}
.login-box .sub{text-align:center;color:var(--faint);margin-top:-8px}
.login-box label{display:flex;flex-direction:column;gap:5px;font-size:13px;font-weight:500;color:var(--muted)}
.login-box input{height:40px;border:1px solid #d1d5db;border-radius:7px;padding:0 12px;font-size:15px;outline:none;background:#fff;color:var(--text)}
.login-box input:focus{border-color:var(--blue);box-shadow:0 0 0 2px rgba(22,119,255,.1)}
.login-box .btn{height:42px;font-size:15px}
.login-box .back{text-align:center;font-size:13px}
.login-box label small{font-weight:normal}
.login-box label.check{flex-direction:row;align-items:center;gap:6px;font-weight:normal}
.login-box label.check input{height:auto}
.setup-box{max-width:440px}
.hint-center{text-align:center;color:var(--muted);font-size:13px}
.code-input{font-size:22px!important;letter-spacing:6px;text-align:center;font-family:ui-monospace,Menlo,Consolas,monospace}
.mono-input{font-family:ui-monospace,Menlo,Consolas,monospace;letter-spacing:1px;text-transform:uppercase}
.totp-bind{display:flex;flex-direction:column;gap:10px;background:#f9fafb;border:1px solid var(--line);border-radius:8px;padding:14px;font-size:13px;color:var(--muted)}
.qr{align-self:center;width:180px;height:180px;background:#fff;padding:6px;border-radius:8px;display:flex;justify-content:center}
.qr svg{width:100%;height:100%}
.secret code{word-break:break-all;user-select:all}

/* ── 弹窗 ── */
dialog.modal{border:none;border-radius:12px;padding:0;width:460px;max-width:calc(100vw - 32px);box-shadow:0 20px 60px rgba(0,0,0,.2);margin:auto;color:var(--text)}
dialog.modal::backdrop{background:rgba(15,23,42,.45)}
dialog.modal .form{margin:0;position:relative}
dialog.modal .form>h2{padding-right:36px}
.dlg-close{position:absolute;top:14px;right:14px;width:32px;height:32px;border:none;background:none;border-radius:8px;font-size:16px;color:var(--faint);cursor:pointer;line-height:1}
.dlg-close:hover{background:#f3f4f6;color:#374151}
.account-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.account-row .hint{flex:1;min-width:200px}
.account-who{display:flex;align-items:center;gap:10px}
.account-who b{display:block;font-size:15px}
.avatar-dot{width:40px;height:40px;border-radius:50%;background:var(--blue-bg);display:flex;align-items:center;justify-content:center;font-size:20px}
.pub-box{text-align:center;align-items:center;padding:28px 28px 22px}
.pub-icon{width:52px;height:52px;border-radius:50%;background:#f0fdf4;color:#16a34a;font-size:28px;line-height:52px;font-weight:700}
.pub-box h2{font-size:18px}
.pub-title{font-size:15px;color:#374151;font-weight:600;word-break:break-word;max-width:100%}
.pub-actions{justify-content:center;width:100%;margin-top:6px}
.ota-info p{margin:4px 0;font-size:14px;color:#374151;word-break:break-word}
.ota-bar{height:8px;background:#eef1f6;border-radius:4px;overflow:hidden}
.ota-bar>div{height:100%;width:0;background:var(--blue);transition:width .3s}

/* ── 编辑器 ── */
.edit-page{overflow:hidden}
.edit-wrap{height:calc(100vh - 52px);display:flex;flex-direction:column;overflow:hidden}
.edit-head{background:#fff;border-bottom:1px solid var(--line);padding:12px 16px;display:flex;align-items:center;gap:10px;flex-wrap:wrap;flex-shrink:0}
.title-input{display:block;flex:1;min-width:200px;height:44px;padding:0 14px;border:1px solid #d1d5db;border-radius:8px;outline:none;font-size:19px;font-weight:700;font-family:inherit;color:var(--text);background:#fff;transition:border-color .15s,box-shadow .15s}
.title-input::placeholder{color:var(--faint);font-weight:500}
.title-input:focus{border-color:var(--blue);box-shadow:0 0 0 2px rgba(22,119,255,.1)}
.edit-foot{flex-shrink:0;background:#fff;border-top:1px solid var(--line);padding:8px 16px;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.edit-foot select,.edit-foot input{height:34px;border:1px solid #d1d5db;border-radius:7px;padding:0 8px;font-size:13px;outline:none;background:#fff;font-family:inherit;color:var(--text)}
.edit-foot input:focus,.edit-foot select:focus{border-color:var(--blue)}
.edit-foot input[type=text]{width:150px}
.views-pick{display:inline-flex;align-items:center;gap:4px;color:var(--muted)}
.views-pick .ic{width:16px;height:16px}
.edit-foot .views-pick input{width:90px}
.edit-foot [hidden]{display:none!important}
.acc-pick{display:inline-flex;align-items:center;gap:4px;font-size:13px;color:var(--muted);white-space:nowrap}
.acc-hint{font-size:12px;padding:2px 10px;border-radius:999px;background:#fef2f2;color:#dc2626;white-space:nowrap}
.edit-foot .save-state{margin-left:auto}
.edit-foot .btn{height:34px}
.edit-foot #publishBtn{padding:0 20px;font-weight:600}
.status-pill{font-size:12px;padding:2px 10px;border-radius:999px;background:#fffbeb;color:#b45309}
.status-pill.publish{background:#f0fdf4;color:#16a34a}
.vd-wrap{flex:1;min-height:0;position:relative}
#vditor{position:absolute;inset:0;border:none!important;border-radius:0!important}
#vditor .vditor-toolbar{padding-left:12px!important}
#vditor .vditor-reset{font-size:15px}

/* ── 分类 ── */
.cat-pick{display:flex;align-items:center;gap:4px}
.cat-pick select{height:44px;min-width:150px;max-width:240px;border:1px solid #d1d5db;border-radius:8px;padding:0 10px;font-size:14px;font-family:inherit;background:#fff;color:var(--text);outline:none}
.cat-pick select:focus{border-color:var(--blue)}
.cat-pick .icon-btn{width:40px;height:40px;border:1px solid var(--line);border-radius:8px;background:#fff}
dialog.modal#catDialog{width:700px}
.cat-head,.cat-row{display:grid;grid-template-columns:44px minmax(110px,1fr) minmax(140px,1.6fr) 118px;gap:8px;align-items:center}
.cat-head{font-size:12px;color:var(--faint);padding:0 2px}
.cat-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;max-height:50vh;overflow-y:auto}
.cat-row input{height:32px;border:1px solid #d1d5db;border-radius:7px;padding:0 8px;font-size:13px;font-family:inherit;outline:none;min-width:0;width:100%}
.cat-row input:focus{border-color:var(--blue)}
.cat-row .cid{font-family:ui-monospace,Consolas,monospace;font-size:12px;color:var(--faint);text-align:center}
.cat-ops{display:flex;gap:6px;justify-content:flex-end;white-space:nowrap}
.cat-ops .btn{height:32px}
.cat-add{padding-top:8px;border-top:1px dashed var(--line)}
.cat-empty{color:var(--faint);font-size:13px;text-align:center;padding:10px}
.cat-ops .linkbtn{padding:2px}

/* ── 附件 / 拖放区 ── */
.dropzone{border:2px dashed #cdd6e4;border-radius:10px;padding:18px;text-align:center;color:var(--muted);margin-bottom:16px;background:#fafbfd;transition:.15s}
.dropzone.over{border-color:var(--blue);background:var(--blue-bg);color:var(--blue)}

/* ── MCP / 反代 / 系统信息 ── */
.mcp-tbl{border:1px solid var(--line);border-radius:8px;overflow:hidden;margin-bottom:16px}
.mcp-tbl .badge{white-space:nowrap;margin-left:0}
.mcp-tbl .w-act{width:80px}
/* AI 接口权限对照表 */
.mcp-perm{width:100%;border-collapse:collapse;font-size:13px;border:1px solid var(--line);border-radius:8px;overflow:hidden}
.mcp-perm th,.mcp-perm td{padding:8px 10px;border-bottom:1px solid var(--line2);text-align:center}
.mcp-perm thead th{background:#f9fafb;color:var(--muted);font-weight:600;font-size:12.5px}
.mcp-perm th:first-child,.mcp-perm td:first-child{text-align:left;color:#374151;white-space:nowrap}
.mcp-perm tbody td{color:var(--blue);font-weight:700}
.mcp-perm tbody td.off{color:#d1d5db;font-weight:normal}
.mcp-perm tbody td.sw{color:#b45309;font-weight:500;font-size:12px}
.mcp-perm tbody tr:last-child td{border-bottom:none}
.form h2 .push-right{flex:1} /* 标题行右侧放本卡片的主动作按钮 */
#mcpTok,#mcpCmd{word-break:break-all}
.proxy-tbl{border:1px solid var(--line);border-radius:8px;overflow:hidden;font-size:13px}
.proxy-tbl th{width:190px;background:#f9fafb;font-weight:500;color:var(--muted)}
.proxy-tbl td,.proxy-tbl th{padding:7px 12px;word-break:break-all;border-bottom:1px solid var(--line2)}
.proxy-tbl tr:last-child td,.proxy-tbl tr:last-child th{border-bottom:none}
.fold>summary{cursor:pointer;color:var(--muted);font-size:13px;list-style:none;display:inline-flex;align-items:center;gap:6px;user-select:none}
.fold>summary::-webkit-details-marker{display:none}
.fold>summary::before{content:"";width:6px;height:6px;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(-45deg);transition:transform .15s;margin:0 2px}
.fold[open]>summary::before{transform:rotate(45deg)}
.fold>summary:hover{color:var(--blue)}
.fold[open]>summary{margin-bottom:10px}
.sysinfo{display:grid;grid-template-columns:max-content 1fr;gap:10px 18px;margin:0;font-size:14px;align-items:center}
.sysinfo dt{color:var(--muted)}
.sysinfo dd{margin:0;display:flex;align-items:center;gap:12px;flex-wrap:wrap;word-break:break-all}
.sysinfo .btn{height:28px;padding:0 10px;font-size:12.5px}
#mcpStep1,#mcpStep2{display:flex;flex-direction:column;gap:18px}
#mcpStep1[hidden],#mcpStep2[hidden]{display:none}

/* ── 信息看板 ── */
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px;margin-bottom:16px}
.stat-card{position:relative;background:#fff;border:1px solid var(--line);border-radius:10px;padding:16px 18px;display:flex;flex-direction:column;gap:2px;color:var(--text);transition:border-color .15s,box-shadow .15s,transform .15s}
a.stat-card:hover{border-color:#93c5fd;box-shadow:0 4px 14px rgba(22,119,255,.08);transform:translateY(-1px)}
.stat-ic{position:absolute;top:14px;right:14px;width:34px;height:34px;border-radius:9px;background:var(--blue-bg);color:var(--blue);display:flex;align-items:center;justify-content:center}
.stat-ic .ic{width:18px;height:18px}
.stat-num{font-size:26px;font-weight:700;color:#111827;line-height:1.25;padding-right:44px}
.stat-label{font-size:13px;color:var(--muted)}
.stat-sub{font-size:12px;color:var(--faint);margin-top:2px}

.dash-cols{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:stretch}
.dash-panel{padding:16px 18px}
.dash-panel>h2{font-size:15px;display:flex;align-items:center;gap:8px;margin-bottom:14px}
.dash-panel>h2 small{font-weight:normal}
.dash-panel>h2 .push-right{flex:1}
.dash-sub{font-size:12.5px;font-weight:600;color:var(--muted);margin:16px 0 10px}

/* 发布趋势柱状图 */
.chart{display:flex;align-items:flex-end;gap:4px;height:120px}
.chart-col{flex:1;height:100%;display:flex;align-items:flex-end;justify-content:center;min-width:0;cursor:default}
.chart .bar{display:block;width:100%;max-width:26px;background:var(--blue);border-radius:3px 3px 0 0;min-height:2px;transition:background .15s}
.chart .bar.zero{background:#e5e7eb}
.chart-col:hover .bar{background:var(--blue-h)}
.chart-lbls{display:flex;gap:4px;margin-top:6px}
.chart-lbls span{flex:1;text-align:center;font-size:10px;color:var(--faint);white-space:nowrap;overflow:hidden}
.chart-lbls span.today{color:var(--blue);font-weight:600}

/* 内容构成 */
.split{margin-bottom:2px}
.split-line{display:flex;justify-content:space-between;font-size:12.5px;color:var(--muted);margin-bottom:7px}
.split-bar{display:flex;height:10px;border-radius:999px;overflow:hidden;background:#f3f4f6}
.split-bar .ai{background:#8b5cf6;transition:width .3s}
.split-bar .human{background:var(--blue);transition:width .3s}
.cat-dist{display:flex;flex-direction:column;gap:8px}
.dist-row{display:flex;align-items:center;gap:10px;font-size:13px}
.dist-name{width:96px;flex-shrink:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#374151}
.dist-track{flex:1;height:8px;background:#f3f4f6;border-radius:999px;overflow:hidden}
.dist-track i{display:block;height:100%;background:var(--blue);border-radius:999px;min-width:2px}
.dist-num{width:34px;text-align:right;color:var(--faint);flex-shrink:0}
.empty-inline{color:var(--faint);font-size:13px;padding:6px 0}

/* 排行 / 最近发布 */
.rank,.recent{display:flex;flex-direction:column}
.rank li,.recent li{display:flex;align-items:center;gap:8px;padding:8px 0;border-bottom:1px solid var(--line2);min-width:0}
.rank li:last-child,.recent li:last-child{border-bottom:none}
.rank li.empty,.recent li.empty{display:block;color:var(--faint);text-align:center;padding:24px 0}
.rank-idx{width:20px;height:20px;flex-shrink:0;border-radius:6px;background:var(--blue-bg);color:var(--blue);font-size:11.5px;font-weight:600;display:flex;align-items:center;justify-content:center}
.rank li:nth-child(1) .rank-idx{background:#fef3c7;color:#b45309}
.rank li:nth-child(2) .rank-idx{background:#f1f5f9;color:#475569}
.rank li:nth-child(3) .rank-idx{background:#ffedd5;color:#c2410c}
.rank-ttl,.recent-ttl{flex:1;min-width:0;color:var(--text);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rank-ttl:hover,.recent-ttl:hover{color:var(--blue)}
.rank-views{display:inline-flex;align-items:center;gap:4px;flex-shrink:0;color:var(--faint);font-size:12.5px}
.rank-views .ic{width:13px;height:13px}
.recent-meta{display:inline-flex;align-items:center;gap:6px;flex-shrink:0}
.recent-meta .badge{margin-left:0}
.recent-meta time{color:var(--faint);font-size:12px}

/* 开发中占位页 */
.dev-panel{padding:64px 24px;display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center}
.dev-icon{width:64px;height:64px;border-radius:18px;background:var(--blue-bg);color:var(--blue);display:flex;align-items:center;justify-content:center}
.dev-icon .ic{width:32px;height:32px}
.dev-panel h2{font-size:18px;color:#111827}
.dev-panel .hint{font-size:14px;margin:0}
@media (max-width:900px){.dash-cols{grid-template-columns:1fr}}
@media (max-width:600px){
  .stat-num{font-size:22px}
  .dist-name{width:70px}
  .chart-lbls span:nth-child(even){visibility:hidden}
}

/* 手机：所有按钮只留图标，不要文字（图标都在，见各按钮的 <svg class="ic">） */
@media (max-width:768px){
  .btn>span,.linkbtn>span,.w-act a>span,.btn-txt{display:none}
  .btn{padding:0 10px}
  .topbar-actions .write-btn{display:inline-flex}
}

/* ── 手机：侧栏变抽屉、内容全宽、表格变卡片 ── */
@media (max-width:768px){
  body{font-size:13px}
  body:not(.login-page){padding-left:0}
  .sidebar{transform:translateX(-100%);transition:transform .25s ease;z-index:60;box-shadow:2px 0 18px rgba(0,0,0,.14)}
  .sidebar.mobile-open{transform:translateX(0)}
  .sidebar-backdrop{display:block}
  .topbar{padding:0 12px}
  .amain{padding:14px 14px 40px;max-width:none}
  .hamburger{display:inline-flex}
  .edit-wrap{margin-left:0}
  .row2{grid-template-columns:1fr}
  .form{padding:16px}
  .toolbar .search select{max-width:40%}
  /* 写文章：只留 标题 / 一行工具栏 / 正文 / 底部「文章类型 + 发表」，其余（分类、类型、时间、草稿、查看）收起，按默认值保存 */
  .edit-wrap{height:calc(100vh - 52px);height:calc(100dvh - 52px)}
  .edit-head{padding:8px 10px}
  .edit-head .title-input{min-width:0;height:40px;font-size:17px}
  .edit-head .cat-pick{display:none}
  .edit-foot{padding:8px 10px;gap:6px;flex-wrap:nowrap;padding-bottom:calc(8px + env(safe-area-inset-bottom))}
  .edit-foot #fType,.edit-foot #fCreated,.edit-foot .views-pick,.edit-foot .status-pill,.edit-foot #viewLink,.edit-foot #saveBtn,.edit-foot .acc-hint{display:none!important}
  .edit-foot input[type=text]{width:0;flex:1;min-width:70px}
  .edit-foot .save-state{margin-left:auto;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
  .edit-foot #publishBtn{flex-shrink:0;width:44px;padding:0;justify-content:center}
  #vditor .vditor-toolbar{padding-left:4px!important;white-space:nowrap}
  #vditor .vditor-toolbar__item{padding:0 5px}
  /* 表格转卡片列表：每个 td 写 data-label */
  table.resp thead{display:none}
  table.resp tr{display:block;border-bottom:1px solid var(--line);padding:6px 2px}
  table.resp tr:last-child{border-bottom:none}
  table.resp td{display:flex;justify-content:space-between;gap:12px;align-items:center;border:none;padding:4px 12px;text-align:right;width:auto!important;white-space:normal}
  table.resp td::before{content:attr(data-label);color:var(--faint);font-size:12px;text-align:left;flex-shrink:0;font-weight:500}
  table.resp td>.cl,table.resp td>div{margin-left:auto}
  table.resp td .cl{justify-content:flex-end}
  table.resp td.actions,table.resp td.w-act{justify-content:flex-end;width:auto}
  table.resp td.actions::before,table.resp td.w-act::before{content:none}
  table.resp td.w-act a,table.resp td.w-act button{margin-left:12px;margin-right:0}
  table.resp td.ic-acts a,table.resp td.ic-acts button{margin-left:4px}
  .hide-m{display:none!important}
  .w-date,.w-num{display:none}
}
@media (max-width:640px){
  .cat-pick{width:100%}
  .cat-pick select{flex:1;max-width:none}
  .cat-head{display:none}
  .cat-row{grid-template-columns:28px 1fr;row-gap:4px}
  .cat-row input:nth-of-type(2){grid-column:2}
  .cat-ops{grid-column:2;justify-content:flex-start}
}
@media (max-width:700px){
  .proxy-tbl th{width:auto}
}

/* ── AI 知识库（知识库版）── */
.kb-notice{display:flex;gap:10px;align-items:flex-start;background:#fffbeb;border:1px solid #fde68a;color:#92400e;border-radius:10px;padding:12px 14px;margin-bottom:16px;font-size:13.5px;line-height:1.7}
.kb-notice .ic{flex-shrink:0;margin-top:3px}
.kb-notice code{background:#fef3c7;border-radius:4px;padding:0 4px}
.kb-err{color:#dc2626}
.kb-search-row{display:flex;gap:8px;flex-wrap:wrap}
.kb-search-row input[name=query]{flex:1 1 280px}
.kb-search-row select{flex:0 0 auto;width:auto!important}
.kb-search-row .kb-part{flex:0 1 150px}
.kb-results{margin-top:12px;display:flex;flex-direction:column;gap:10px}
.kb-hit{border:1px solid var(--line);border-radius:8px;padding:10px 12px}
.kb-hit-title{font-weight:600;font-size:14px;margin-bottom:2px}
.kb-chunk-meta{font-size:12px;color:var(--faint);margin-bottom:6px;word-break:break-all}
.kb-chunk-text{white-space:pre-wrap;word-break:break-word;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12.5px;line-height:1.6;background:#f9fafb;border-radius:6px;padding:8px 10px;margin:0;max-height:320px;overflow:auto;color:#374151}
dialog.modal.kb-wide{width:860px}
.kb-docs .w-act{width:270px}
.kb-chunks{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px;max-height:60vh;overflow:auto}
.kb-acl-colls{display:flex;flex-direction:column;gap:6px;border:1px solid var(--line);border-radius:8px;padding:10px 12px;max-height:240px;overflow:auto}
.kb-acl-one{padding-left:20px}
.kb-ok{color:#16a34a}
.kb-eptest-row td{background:#f9fafb}
.kb-search-row select{flex:0 0 auto}

/* ── 总控后台（PocketBase 版，console.html） ── */
.tbl-wrap{overflow-x:auto}
.tbl-wrap .tbl{min-width:760px}
.toolbar .hint{flex:1;min-width:200px}
dialog.modal.wide{width:760px}
.con-pre{background:#f9fafb;border:1px solid var(--line);border-radius:8px;padding:10px 12px;font:12.5px/1.6 ui-monospace,Menlo,Consolas,monospace;white-space:pre-wrap;word-break:break-all;max-height:55vh;overflow:auto;color:#374151}
.site-acts{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:4px 10px}
.site-acts .linkbtn{margin:0}
.sidebar-footer .ver{margin:0}
.tbl-wrap .w-act{width:300px}
@media (max-width:760px){
  .tbl-wrap .tbl{min-width:0}
  .tbl-wrap thead{display:none}
  .tbl-wrap tr{display:block;padding:10px 0;border-bottom:1px solid var(--line2)}
  .tbl-wrap tr:last-child{border-bottom:none}
  .tbl-wrap td{display:block;border:none;padding:4px 14px;width:auto!important;text-align:left}
  .tbl-wrap .site-acts{justify-content:flex-start}
}
