:root{--bg:#f6f8fa;--text:#202a35;--muted:#7b8492;--line:#e9edf1;--primary:#167b64;--primary-soft:#eaf5f0;--danger:#cb4d4d;--sidebar:240px;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;color:var(--text);font-size:14px;line-height:1.6}*{box-sizing:border-box}body{margin:0;background:var(--bg)}button,input,select,textarea{font:inherit}button,a,input,textarea,select{-webkit-tap-highlight-color:transparent}button{cursor:pointer;color:inherit}button:disabled{opacity:.5;cursor:not-allowed}a{color:inherit;text-decoration:none}h1,h2,h3,p{margin:0}h1{font-size:28px;letter-spacing:-.8px;line-height:1.4;font-weight: 600}h2{font-size:18px;font-weight: 600}h3{font-size:15px;font-weight:600}small{font-size:12px}.muted{color:var(--muted);font-size:12px}[hidden]{display:none!important}:focus-visible{outline:3px solid #85c6b4;outline-offset:3px}.skip-link{position:fixed;top:-60px;left:20px;z-index:100;background:var(--primary);color:white;padding:12px}.skip-link:focus{top:10px}
.sidebar{width:var(--sidebar);position:fixed;inset:0 auto 0 0;background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;z-index:40;padding:27px 18px 0;overflow-y:auto}.brand{display:flex;align-items:center;gap:11px;padding:0 13px;font-size:19px;letter-spacing:1px;font-weight:700}.brand small{display:block;letter-spacing:1.6px;font-size:8px;color:#929ba6;margin-top:1px}.brand-mark{width:35px;height:39px;background:var(--primary);color:white;border-radius:11px;display:grid;place-items:center;font-size:27px;line-height:1;position:relative;font-style:italic;font-weight:600}.brand-mark span{width:8px;height:8px;position:absolute;right:-2px;top:-2px;background:#b6e6ad;border:2px solid white;border-radius:50%}.workspace{margin:30px 0 22px;padding:12px 10px;border:1px solid var(--line);border-radius:10px;display:flex;gap:10px;align-items:center}.workspace-avatar{display:grid;place-items:center;background:#f2f0e9;color:#857452;width:33px;height:33px;border-radius:8px}.workspace>div{min-width:0;flex:1}.workspace strong{display:block;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.workspace small{display:block;font-size:10px;color:var(--muted)}.workspace-dot{height:6px;width:6px;background:#52a88a;border-radius:50%}.nav-label{font-size:10px;color:#99a0ab;letter-spacing:1px;margin:20px 14px 9px}.nav-link{display:flex;align-items:center;gap:12px;padding:10px 14px;border-radius:7px;margin:3px 0;color:#626c79;font-size:13px;transition:.15s}.nav-link:hover{background:#f5f7f9;color:#283b38}.nav-link.active{background:var(--primary-soft);color:var(--primary);font-weight:600}.nav-link.active:after{content:"";height:5px;width:5px;border-radius:50%;background:var(--primary);margin-left:auto}.icon{width:19px;height:19px;display:inline-block;flex-shrink:0;vertical-align:middle}.sidebar-bottom{margin-top:auto;padding-top:28px}.sidebar-note{padding:16px 12px;background:#f7faf8;border-radius:10px}.sidebar-note strong{font-size:11px;display:block;margin:5px 0}.sidebar-note p{font-size:10px;color:#8a9690;line-height:1.9}.small-spark{color:#75a88a;font-size:21px}.back-chat{margin:17px 8px;display:flex;justify-content:space-between;font-size:12px;color:#60776d}.account{padding:18px 9px;border-top:1px solid var(--line);display:flex;gap:10px;align-items:center}.avatar{width:32px;height:32px;border-radius:50%;background:#eaf0f7;color:#668098;display:inline-grid;place-items:center;font-size:12px;flex-shrink:0}.account strong{display:block;font-size:11px}.account small{display:block;color:#a0a7af;font-size:10px}
.main-shell{margin-left:var(--sidebar);min-height:100vh;display:flex;flex-direction:column}.topbar{height:76px;position:sticky;top:0;z-index:20;background:rgba(255,255,255,.96);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 36px;gap:15px}.breadcrumb{display:flex;gap:15px;align-items:center;font-size:12px;color:#939ba5;white-space:nowrap}.breadcrumb strong{font-weight:500;color:#4b5865}.divider{color:#d2d7dd}.top-actions,.actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.save-state{font-size:11px;color:#8d969f;margin-right:8px}.save-state.dirty{color:#bb873d}.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:9px 15px;min-height:38px;border:1px solid #dfe5e9;border-radius:7px;background:white;font-size:12px;line-height:1.5;font-weight:500;white-space:nowrap;transition:.15s}.button:hover{background:#f4f7f6;border-color:#bbcfc5}.button.primary{background:var(--primary);border-color:var(--primary);color:white;box-shadow:0 2px 2px #176a5010}.button.primary:hover{background:#11624f}.button.soft{background:var(--primary-soft);border-color:transparent;color:var(--primary)}.button.danger{color:var(--danger);border-color:#efd5d5}.button.small{padding:5px 10px;min-height:30px;font-size:11px}.icon-button{border:0;background:transparent;border-radius:6px;padding:6px 9px;color:#86909b}.icon-button:hover{background:#f0f3f4}.mobile-menu{display:none}main{padding:34px 36px 40px;width:100%;max-width:1600px;margin:0 auto;flex:1}.page-heading{display:flex;justify-content:space-between;align-items:center;gap:24px;margin-bottom:28px}.eyebrow{font-size:9px;font-weight:600;letter-spacing:2px;color:#8d9c96;margin-bottom:7px}.page-heading p{font-size:12px;color:var(--muted);margin-top:8px}.footer{padding:18px 36px;border-top:1px solid var(--line);display:flex;justify-content:space-between;color:#a1a8b0;font-size:10px;gap:10px}
.hero{background:#eaf2ed;border:1px solid #dde9e0;border-radius:13px;padding:30px 34px;display:flex;justify-content:space-between;align-items:center;position:relative;overflow:hidden;margin-bottom:24px;gap:30px}.hero-label{display:inline-flex;gap:7px;align-items:center;color:#47745e;font-size:10px;font-weight:500;letter-spacing:1px;margin-bottom:11px}.hero h2{font-size:24px;letter-spacing:-.5px;color:#234f3d}.hero p{font-size:12px;color:#738d7d;margin:9px 0 20px;max-width:510px}.hero-art{width:150px;height:130px;position:relative;flex-shrink:0;margin-right:28px}.art-ring{position:absolute;width:118px;height:118px;border:1px solid #bfd5c6;border-radius:50%;top:4px;left:15px}.art-ring:after{content:"";position:absolute;inset:13px;border:1px dashed #c2d7c9;border-radius:50%}.art-card{position:absolute;top:26px;left:12px;background:#fff;border:1px solid #dbe7de;width:129px;height:79px;border-radius:12px;transform:rotate(-9deg);box-shadow:0 9px 15px #315c3710;padding:16px}.art-card:before{content:"";display:block;background:#dfebe2;height:7px;border-radius:4px;width:69px;box-shadow:0 15px 0 #eef3ef}.art-card:after{content:"✦";color:white;background:var(--primary);border-radius:10px;font-size:23px;width:37px;height:37px;text-align:center;position:absolute;right:-12px;bottom:-10px;transform:rotate(18deg)}.stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:17px;margin-bottom:24px}.stat{background:white;border:1px solid var(--line);border-radius:10px;padding:20px 22px}.stat-head{display:flex;justify-content:space-between;align-items:center;color:#86938f;font-size:11px}.stat-head .icon{width:16px;height:16px;color:#9aaba3}.stat-value{font-size:30px;font-weight: 600;letter-spacing:-1px;margin:8px 0 2px;font-variant-numeric:tabular-nums}.stat-foot{font-size:10px;color:#a1a7af}.stat-foot span{color:var(--primary)}.two-columns{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(280px,1fr);gap:22px;align-items:start}.panel{background:white;border:1px solid var(--line);border-radius:10px;margin-bottom:22px;overflow:hidden}.panel-header{padding:19px 23px;display:flex;justify-content:space-between;align-items:center;gap:15px;border-bottom:1px solid #f0f2f4}.panel-header p{font-size:11px;color:var(--muted);margin-top:3px}.panel-body{padding:23px}.panel-body>p{font-size:12px}.section-number{font-size:11px;color:#9caaa3;margin-right:9px;font-weight:400}.quick-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px}.quick-link{padding:17px;border:1px solid var(--line);border-radius:8px;display:flex;gap:12px;align-items:center;transition:.2s}.quick-link:hover{border-color:#9ec2af;background:#fafdfb}.quick-icon{color:#548675;background:#eff6f2;border-radius:8px;padding:10px;display:inline-flex}.quick-link strong{font-size:12px;display:block}.quick-link small{font-size:10px;color:#959da6;display:block;margin-top:4px}.quick-link .arrow{margin-left:auto;color:#a9b6af}.check-row{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid #f1f3f5;font-size:12px}.check-row:last-child{border:0}.check-dot{background:#eaf5ee;color:#438967;border-radius:50%;font-size:10px;width:20px;height:20px;display:grid;place-items:center}.check-dot.pending{background:#f6f0e4;color:#b69254}.check-row>a{margin-left:auto;color:var(--primary);font-size:11px}.notice{padding:14px 17px;background:#f2f7f4;border:1px solid #e1ece5;border-radius:8px;color:#718478;font-size:12px;line-height:1.9;margin-bottom:20px}.notice.warning{background:#fffbf1;border-color:#f2e8cb;color:#9c804b}.notice strong{color:#486858}.pill{font-size:10px;display:inline-flex;align-items:center;padding:3px 9px;border-radius:5px;background:#f0f3f6;color:#7e8793;white-space:nowrap;gap:4px}.pill.green{background:#eaf5ef;color:#43876b}.pill.blue{background:#eef3fb;color:#6988b5}.pill.orange{background:#fcf4e8;color:#b38d51}.pill.red{background:#fbeeee;color:#b66b6b}.pill.purple{background:#f4effa;color:#9174ab}.pill.pink{background:#fcf0f5;color:#ae708c}.toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:20px;flex-wrap:wrap}.toolbar-left{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.toolbar input{max-width:280px}.toolbar select{max-width:200px}.search{position:relative;min-width:200px}.search input{padding-left:34px!important}.search .icon{position:absolute;top:11px;left:10px;width:16px;height:16px;color:#9aa3ad}.segment{display:flex;gap:5px;background:#eef1f3;padding:4px;border-radius:8px;flex-wrap:wrap}.segment button{border:0;background:transparent;padding:7px 14px;font-size:12px;color:#89939d;border-radius:5px}.segment button.active{background:white;color:#315448;box-shadow:0 1px 4px #273b3010}.service-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.service-card{background:white;border:1px solid var(--line);border-radius:10px;padding:23px;display:flex;flex-direction:column}.service-card-top{display:flex;justify-content:space-between;gap:14px;align-items:center;margin-bottom:15px}.service-symbol{height:40px;width:40px;background:#edf5f0;color:#628875;border-radius:10px;display:grid;place-items:center;font-size:18px}.service-card h3{font-size:16px}.service-card p{font-size:12px;color:#8a949e;margin:7px 0 17px;min-height:38px;white-space:pre-wrap}.service-counts{display:flex;gap:22px;color:#8e99a3;font-size:11px;margin-top:auto;padding:14px 0;border-top:1px solid #f0f3f5}.service-counts strong{color:#53605c;margin-right:4px}.card-actions{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:10px}.switch{display:inline-flex;align-items:center;gap:8px;font-size:11px;color:#85908b;cursor:pointer}.switch input{width:30px!important;height:17px;appearance:none;background:#d8dfe2;border:0;border-radius:12px;position:relative;padding:0!important;transition:.2s;cursor:pointer;flex-shrink:0}.switch input:before{content:"";position:absolute;background:white;width:13px;height:13px;border-radius:50%;top:2px;left:2px;box-shadow:0 1px 2px #0002;transition:.2s}.switch input:checked{background:var(--primary)}.switch input:checked:before{transform:translateX(13px)}.service-selector{display:flex;gap:14px;align-items:center;background:white;border:1px solid var(--line);padding:15px 20px;border-radius:10px;margin-bottom:20px}.service-selector label{font-size:12px;color:#7b8c83;white-space:nowrap}.service-selector select{max-width:300px}.service-selector .pill{margin-left:auto}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.field{display:flex;flex-direction:column;gap:7px;min-width:0}.field.full{grid-column:1/-1}.field label,.field-title{font-size:12px;color:#55626d;font-weight:500}.required{color:#c97070;margin-left:3px}.field small{font-size:10px;color:#9aa4ad;font-weight:400}.field input,.field textarea,.field select,.toolbar input,.toolbar select,.service-selector select{width:100%;border:1px solid #e1e6ea;border-radius:6px;background:#fff;padding:9px 11px;color:#3c4853;font-size:12px;outline:none;transition:.15s;min-height:38px}.field input:focus,.field textarea:focus,.field select:focus,.toolbar input:focus{border-color:#6ca68e;box-shadow:0 0 0 3px #eaf5ef}.field input:disabled{background:#f6f8f9;color:#9aa2aa}.field textarea{resize:vertical;min-height:84px;line-height:1.9}.field input::placeholder,.field textarea::placeholder{color:#b1b9c1}.field-note{font-size:10px;color:#9ca5ae;line-height:1.7}.preview-card{background:#f8faf9;border:1px solid #e6eee9;border-radius:9px;padding:20px}.preview-title{font-size:10px;color:#9aa9a0;letter-spacing:1px;margin-bottom:16px}.chat-preview{display:flex;align-items:flex-start;gap:9px;margin-top:13px}.chat-preview .avatar{background:#e0efe6;color:#4c7b60;border-radius:9px;font-size:11px}.chat-bubble{background:white;border:1px solid #e7ece9;border-radius:0 11px 11px 11px;padding:12px 15px;font-size:12px;color:#68776e;white-space:pre-wrap;max-width:100%;overflow-wrap:anywhere}.preview-footer{font-size:10px;color:#a4afa8;margin-top:18px}.table-wrap{overflow-x:auto}table{width:100%;border-collapse:collapse;font-size:12px;text-align:left}th{background:#fbfcfd;color:#9aa2ac;font-size:10px;font-weight:500;padding:12px 20px;white-space:nowrap;border-bottom:1px solid var(--line)}td{padding:16px 20px;border-bottom:1px solid #f0f2f4;color:#72808d;max-width:300px;overflow-wrap:anywhere}tr:last-child td{border-bottom:0}tbody tr:hover{background:#fcfdfd}td strong{font-weight:500;color:#3f4e58}td small{display:block;color:#9da6af;font-size:10px;margin-top:4px}.row-title{display:flex;gap:10px;align-items:center}.row-actions{display:flex;gap:5px;justify-content:flex-end}.row-actions button{border:0;background:transparent;font-size:11px;padding:5px 7px;color:#578676;border-radius:4px;white-space:nowrap}.row-actions button:hover{background:#edf5f0}.row-actions button.danger{color:#bd7777}.empty{padding:48px 24px;text-align:center;color:#99a4ad}.empty .icon{height:32px;width:32px;stroke-width:1;margin-bottom:12px;color:#a5b6aa}.empty strong{display:block;color:#6e7c86;font-size:14px;margin-bottom:7px}.empty p{font-size:12px;margin-bottom:18px}.table-footer{padding:13px 20px;display:flex;justify-content:space-between;align-items:center;border-top:1px solid var(--line);font-size:11px;color:#939ca6}.table-footer .actions{gap:7px}.stage-list{display:flex;flex-direction:column;gap:14px}.stage{display:flex;gap:16px;padding:20px;border:1px solid var(--line);border-radius:8px}.stage-index{height:28px;width:28px;border-radius:8px;background:#edf4ef;display:grid;place-items:center;color:#70947e;font-size:12px;flex-shrink:0}.stage-body{flex:1;min-width:0}.stage p{font-size:12px;color:#8a959e;margin-top:6px;white-space:pre-wrap;overflow-wrap:anywhere}.stage-script{font-size:11px;background:#f8faf9;padding:12px 15px;margin-top:12px;border-radius:6px;color:#7a8a81;white-space:pre-wrap}.stage .row-actions{align-items:flex-start}.tag-list{display:flex;gap:5px;flex-wrap:wrap}.tag-rule-head{display:flex;gap:10px;align-items:center}.detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.detail-item{padding:12px 15px;background:#f7f9fa;border-radius:7px;overflow-wrap:anywhere}.detail-item small{color:#8f9aa4;display:block;margin-bottom:5px}.detail-item p{font-size:12px;white-space:pre-wrap}.detail-item.full{grid-column:1/-1}.error-box{padding:26px;border:1px solid #efdddd;background:#fffafa;border-radius:9px;color:#ac6565}.error-box .button{margin-top:15px}.text-link{color:var(--primary);font-size:11px}.spaced{margin-top:20px}
dialog{width:min(690px,calc(100vw - 32px));max-height:90vh;border:1px solid #e5ece7;border-radius:13px;padding:0;box-shadow:0 30px 90px #1c392835;color:var(--text)}dialog::backdrop{background:#1d302a66;backdrop-filter:blur(3px)}dialog form{display:flex;flex-direction:column;max-height:88vh}.dialog-header{padding:23px 26px 19px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center}.dialog-header h2{font-size:20px}.dialog-body{padding:24px 26px;overflow-y:auto}.dialog-footer{padding:16px 26px;background:#fafcfb;border-top:1px solid var(--line);display:flex;gap:10px;align-items:center}.dialog-footer>span{margin-right:auto;font-size:10px}.toast-area{position:fixed;top:90px;right:28px;z-index:100;display:flex;gap:10px;flex-direction:column;max-width:min(400px,calc(100vw - 32px))}.toast{padding:13px 20px;background:#fff;border:1px solid #dbe9e0;box-shadow:0 6px 25px #203d2914;border-radius:8px;font-size:12px;color:#3c7656;animation:appear .2s ease}.toast.error{color:#b45656;border-color:#efd3d3}.loading{display:flex;gap:12px;align-items:center;justify-content:center;padding:90px 20px;color:#92a099;font-size:12px}.spinner{height:18px;width:18px;border:2px solid #d8e5dd;border-top-color:var(--primary);border-radius:50%;animation:spin .7s linear infinite}.sidebar-backdrop{position:fixed;inset:0;background:#20382c66;border:0;z-index:35}@keyframes spin{to{transform:rotate(360deg)}}@keyframes appear{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}
@media(min-width:1550px){main{padding:40px 50px}.hero{padding:36px 38px}.stats-grid{gap:22px}.stat{padding:24px}.page-heading{margin-bottom:30px}}@media(max-width:1150px){:root{--sidebar:215px}main{padding:28px 24px}.topbar{padding:0 24px}.two-columns{grid-template-columns:1fr}.hero-art{margin-right:0}.stat{padding:17px}.quick-link{padding:14px}.save-state{max-width:140px}.service-card{padding:18px}}@media(max-width:800px){:root{--sidebar:0px}.sidebar{width:240px;transform:translateX(-100%);transition:transform .2s}.sidebar.open{transform:translateX(0)}.mobile-menu{display:inline-flex}.topbar{height:65px;padding:0 18px}.breadcrumb{gap:10px}.breadcrumb>span{display:none}.top-actions{gap:6px}.save-state{display:none}main{padding:24px 18px}.page-heading{align-items:flex-start;gap:12px}.page-heading h1{font-size:24px}.page-heading p{max-width:270px;font-size:11px}.hero{padding:23px}.hero h2{font-size:21px}.hero-art{display:none}.stats-grid{grid-template-columns:1fr 1fr;gap:12px}.stat-value{font-size:26px}.service-grid{grid-template-columns:1fr}.form-grid{gap:17px}.footer{padding:18px;flex-direction:column;font-size:9px}.panel-body{padding:20px}.panel-header{padding:17px 20px}.toolbar input{max-width:100%}.toast-area{top:76px;right:16px}.service-selector{flex-wrap:wrap}.service-selector select{max-width:100%;flex:1}.service-selector .pill{display:none}th,td{padding:13px 16px}.dialog-footer>span{display:none}.dialog-footer{justify-content:flex-end}.stage{padding:16px;gap:10px}.stage .row-actions{flex-direction:column}}@media(max-width:480px){.form-grid{grid-template-columns:1fr}.quick-grid{grid-template-columns:1fr}.page-heading{flex-direction:column}.page-heading p{max-width:100%}.top-actions .button{padding:8px 11px;font-size:11px}.panel-body{padding:17px}.service-selector{gap:10px}.service-selector label{width:100%}.detail-grid{grid-template-columns:1fr}.segment button{padding:7px 10px}.dialog-body,.dialog-header{padding:20px}.hero p{font-size:11px}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
.prompt-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:22px;align-items:start}.prompt-editor{display:block;width:100%;min-height:620px;margin-top:10px;padding:18px;border:1px solid #dce6df;border-radius:8px;background:#fbfdfc;color:#364a40;font:13px/1.9 ui-monospace,Consolas,"Microsoft YaHei",monospace;resize:vertical;tab-size:2;outline:none}.prompt-editor:focus{border-color:#6ca68e;box-shadow:0 0 0 3px #eaf5ef}.prompt-editor-footer{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-top:14px}.prompt-variables{display:flex;flex-direction:column;gap:9px}.prompt-variable{display:block;text-align:left;width:100%;padding:11px 12px;background:#fafcfb;border:1px solid #e9eeeb;border-radius:7px;color:#61766a}.prompt-variable:hover{border-color:#9bbba8;background:#eff7f2}.prompt-variable>span{display:flex;justify-content:space-between;gap:8px;align-items:center}.prompt-variable code{font-size:11px;color:#3b7d61;overflow-wrap:anywhere}.prompt-variable small{display:block;font-size:10px;color:#8d9b92;margin-top:6px}.prompt-preview{margin:0;max-height:640px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font:12px/1.9 ui-monospace,Consolas,"Microsoft YaHei",monospace;color:#66776c;background:#f8fbf9;border:1px solid #e9efeb;border-radius:8px;padding:20px}.prompt-editor-panel{min-width:0}@media(max-width:1150px){.prompt-layout{grid-template-columns:1fr}.prompt-variables{display:grid;grid-template-columns:1fr 1fr}.prompt-variables>p{grid-column:1/-1}.prompt-editor{min-height:480px}}@media(max-width:480px){.prompt-variables{grid-template-columns:1fr}.prompt-editor{font-size:12px;padding:12px;min-height:460px}.prompt-editor-footer{align-items:flex-start;flex-direction:column}}
/* 登录与后台使用同一套配色。未验证身份前不展示后台内容。 */
.auth-locked > .sidebar,.auth-locked > .main-shell { visibility:hidden; }
/* 鉴权结果回来之前两边都不显示：否则刷新后先闪一下登录页再跳进后台。
   bootstrapAuth 结束（成功或失败）时才移除 auth-pending。 */
.auth-pending .login-screen { display:none !important; }
.auth-pending > .sidebar,.auth-pending > .main-shell { visibility:hidden; }
/* 空白等待期给一个轻提示，避免用户以为页面卡住 */
.auth-pending::after { content:''; position:fixed; left:50%; top:50%; width:28px; height:28px; margin:-14px 0 0 -14px;
  border:2px solid #d7e2da; border-top-color:var(--primary-strong,#2f6b4f); border-radius:50%;
  animation:authspin .8s linear infinite; }
@keyframes authspin { to { transform:rotate(360deg); } }
.login-screen {position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:24px;background:radial-gradient(ellipse at 20% 10%,#dcefe2,transparent 55%),#f5f7f3;overflow:auto;}
.login-screen[hidden] {display:none;}
.login-card {width:min(100%,420px);padding:38px;background:#fff;border:1px solid #e1e8df;border-radius:24px;box-shadow:0 24px 70px #203b2910;display:flex;flex-direction:column;gap:14px;}
.login-card h1 {font-size:27px;margin:0;letter-spacing:-1px;}
.login-card p {color:#68776d;margin:0 0 8px;}
.login-card label {font-size:13px;font-weight:600;}
.login-card input {width:100%;padding:12px;border:1px solid #dbe4da;border-radius:9px;font:inherit;background:#fbfcfa;}
.login-card input:focus {outline:2px solid #568267;outline-offset:2px;}
.login-card .login-error {color:#ac4434;line-height:1.6;font-size:13px;min-height:21px;overflow-wrap:anywhere;}
.login-card a {text-align:center;color:#607969;font-size:13px;margin-top:6px;}
/* 账号区：名字与角色各占一行、超长省略；按钮放不下时整体换到下一行，
   不再把文字挤成“一列一个字”。 */
.account .button {margin-left:0;flex:0 0 auto;}
.account .button:nth-of-type(1) {margin-left:auto;}
.rule-workspace{display:grid;grid-template-columns:minmax(0,1fr) 250px;gap:24px;align-items:start}
.rule-sections{min-width:0}.rule-section{scroll-margin-top:100px}.rule-heading{display:flex;gap:14px;align-items:flex-start}
.rule-number{display:grid;place-items:center;flex-shrink:0;width:32px;height:32px;border-radius:9px;background:#edf5ef;color:#5f8971;font:600 12px/1 ui-monospace,monospace}
.rule-heading label{font-size:15px;font-weight: 600;color:#2a4436;cursor:pointer}.rule-heading p{margin-top:7px}
.rule-input{display:block;box-sizing:border-box;width:100%;resize:vertical;min-height:120px;border:1px solid #dce6df;border-radius:9px;padding:15px 17px;background:#fcfdfb;color:#364a40;font:14px/1.9 system-ui,"Microsoft YaHei",sans-serif}
.rule-input::placeholder{color:#9aa79e}.rule-input:focus{outline:2px solid #77a58b;outline-offset:2px}
.rule-guide{position:sticky;top:100px}.rule-guide nav{display:grid;gap:4px}.rule-guide nav button{border:0;border-radius:7px;text-align:left;padding:9px 10px;color:#62786b;background:transparent;font:inherit;cursor:pointer}.rule-guide nav button:hover,.rule-guide nav button:focus-visible{background:#edf5ef;color:#247359}
.rule-help{border-top:1px solid #e8eee9;margin-top:16px;padding-top:20px;color:#738477;font-size:12px;line-height:1.9}.rule-help strong{color:#405c4b}.rule-help p{margin:8px 0 14px}.rule-guide #promptDraftState{display:block;margin-top:16px;font-size:11px}
.rule-preview>summary{padding:20px 24px;color:#607668;cursor:pointer;font-size:13px}.rule-preview-actions{display:flex;gap:10px;margin:18px 0}.rule-preview{margin-top:4px}
@media(max-width:1100px){.rule-workspace{grid-template-columns:minmax(0,1fr)}.rule-guide{position:static;grid-row:1}.rule-guide .rule-help,.rule-guide #promptDraftState{display:none}.rule-guide nav{display:flex;flex-wrap:wrap;gap:6px}.rule-guide nav button{background:#f3f7f3;font-size:12px;padding:7px 10px}.rule-guide .panel-body{padding:14px 18px}.rule-guide .panel-header{display:none}}
@media(max-width:480px){.rule-input{font-size:13px;padding:12px}.rule-heading{gap:10px}.rule-heading label{font-size:14px}.rule-number{width:28px;height:28px}.rule-preview>summary{padding:18px}}
.migration-item{padding:20px 0;border-bottom:1px solid var(--line)}.migration-item:first-child{padding-top:0}.migration-item:last-child{padding-bottom:0;border-bottom:0}.migration-item h3{font-size:13px;font-weight:500;color:#3f4e58;margin-bottom:14px;overflow-wrap:anywhere}.migration-item>.field-note{margin-top:12px}.migration-timing{margin-top:14px;padding:16px;background:#f8faf9;border:1px solid #e6eee9;border-radius:8px}.migration-timing>.field-note{margin-bottom:14px}.migration-timing .form-grid{gap:14px}
/* ===== 2026-10-25 管理端可读性与效率改造（单一覆盖层） ===== */
:root{
  --bg:#f4f6f5;--surface:#fff;--text:#1a2530;--text-2:#475467;--muted:#667085;
  --line:#e4e7ec;--line-soft:#f0f2f4;
  --primary:#0f766e;--primary-strong:#0b5f59;--primary-soft:#e6f4f0;
  --danger:#b42318;--warning:#b54708;--success:#067647;
  --radius:14px;--radius-sm:9px;
  --shadow-sm:0 1px 2px rgba(16,24,40,.05);
  --shadow-md:0 10px 28px rgba(16,24,40,.08);
  --ring:0 0 0 3px rgba(15,118,110,.24);
  font-size:15px;line-height:1.65;
}
body{color:var(--text);background:var(--bg);-webkit-font-smoothing:antialiased}
h1{font-size:30px;line-height:1.25;font-weight:700;letter-spacing:0}
h2{font-size:20px;font-weight: 600;letter-spacing:0}
h1,h2{letter-spacing:0}
h3{font-size:16px;font-weight:600}
small{font-size:13px}
.muted{font-size:13px;color:var(--muted)}
.eyebrow{font-size:11px;letter-spacing:.14em;color:#5d6b7a;font-weight:600}
:focus-visible{outline:none;box-shadow:var(--ring);border-radius:6px}

/* 侧栏 */
.sidebar{width:256px;padding:24px 16px 0;border-right:1px solid var(--line);background:var(--surface)}
:root{--sidebar:256px}
.brand{font-size:20px}
.brand small{font-size:10px;letter-spacing:.16em;color:#7a8797}
.workspace{margin:22px 0 18px;padding:12px;border-radius:12px}
.workspace strong{font-size: 13px}
.workspace small{font-size:12px;color:var(--muted)}
.nav-label{font-size: 12px;letter-spacing:.08em;color:#7a8797;margin:18px 12px 8px;font-weight:600}
.nav-link{min-height:42px;padding:10px 12px;border-radius:9px;font-size:14px;color:#3f4b59;gap:11px}
.nav-link:hover{background:#f3f6f5;color:#1f2937}
.nav-link.active{background:var(--primary-soft);color:var(--primary-strong);font-weight:600;box-shadow:inset 3px 0 0 var(--primary)}
.nav-link.active:after{display:none}
.sidebar-note{padding:14px;border-radius:12px}
.sidebar-note strong{font-size: 12px}
.sidebar-note p{font-size:12px;line-height:1.75;color:var(--muted)}
.back-chat{font-size:13px;padding:4px 2px}
.account{display:flex;flex-wrap:wrap;align-items:center;padding:14px 4px;gap:8px}
.account>div{flex:1 1 auto;min-width:76px}
.account strong,.account small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.account strong{font-size:13px}
.account small{font-size:12px;color:var(--muted)}

/* 顶栏与按钮 */
.topbar{height:68px;padding:0 32px;background:rgba(255,255,255,.92);backdrop-filter:saturate(1.4) blur(8px)}
.breadcrumb{font-size:13px;color:var(--muted);gap:10px}
.breadcrumb strong{color:var(--text-2);font-weight:600}
.save-state{font-size:13px;color:var(--muted)}
.save-state.dirty{color:var(--warning)}
.button{min-height:40px;padding:0 16px;border-radius:9px;font-size: 13px;font-weight:600;border-color:#d5dbe3;box-shadow:var(--shadow-sm)}
.button:hover{border-color:#b9c4d0;background:#f7f9f8}
.button.primary{background:var(--primary);border-color:var(--primary);box-shadow:0 2px 6px rgba(15,118,110,.22)}
.button.primary:hover{background:var(--primary-strong);border-color:var(--primary-strong)}
.button.soft{background:var(--primary-soft);color:var(--primary-strong)}
.button.danger{color:var(--danger);border-color:#f0d6d3;background:#fff}
.button.small{min-height:32px;padding:0 11px;font-size: 12px}
.icon-button{padding:8px 10px;border-radius:8px;min-width:36px;min-height:36px;color:#5d6b7a}
.icon-button:hover{background:#f2f5f4;color:var(--text)}

/* 页面骨架 */
main{padding:32px 32px 44px}
.page-heading{margin-bottom:24px;align-items:flex-start}
.page-heading h1{font-size:30px}
.page-heading p{font-size:14px;color:var(--muted);margin-top:6px}
.footer{font-size:12px;color:#7a8797;padding:18px 32px}

/* 面板与卡片 */
.panel{border-radius:var(--radius);box-shadow:var(--shadow-sm);margin-bottom:20px;border-color:var(--line)}
.panel-header{padding:18px 22px;border-bottom:1px solid var(--line-soft)}
.panel-header h2,.panel-header h3{font-size:16px}
.panel-header p{font-size:13px;color:var(--muted)}
.panel-body{padding:22px}
.section-number{font-size: 12px;color:#6b7a89}
.hero{border-radius:var(--radius);padding:28px 30px}
.hero h2{font-size:26px;color:#153f31}
.hero p{font-size:14px;color:#456054;max-width:620px}
.stats-grid{gap:16px}
.stat{border-radius:var(--radius);padding:20px;box-shadow:var(--shadow-sm)}
.stat-head{font-size: 12px;color:var(--muted)}
.stat-value{font-size:32px}
.stat-foot{font-size: 12px;color:#7a8797}
.quick-link{padding:16px;border-radius:12px}
.quick-link strong{font-size:14px}
.quick-link small{font-size: 12px;color:var(--muted)}
.check-row{font-size: 13px;padding:13px 0}
.check-row>a{font-size: 12px}
.notice{font-size: 13px;line-height:1.8;border-radius:10px;padding:14px 16px;color:#4d5d55}
.pill{font-size:12px;padding:4px 9px;border-radius:6px;font-weight:500;white-space:nowrap}

/* 服务卡 */
.service-grid{gap:18px}
.service-card{border-radius:var(--radius);padding:22px;box-shadow:var(--shadow-sm)}
.service-card h3{font-size:17px}
.service-card p{font-size: 13px;color:var(--muted);line-height:1.7;min-height:44px}
.service-counts{font-size: 12px;color:#6b7a89;padding:13px 0}
.switch{font-size: 12px;color:var(--muted)}

/* 表单 */
.field{gap:8px}
.field label,.field-title{font-size: 13px;font-weight:600;color:#344054}
.field small,.field-note{font-size: 12px;color:var(--muted);line-height:1.6}
.field input,.field textarea,.field select,.toolbar input,.toolbar select,.service-selector select{
  font-size:14px;min-height:42px;padding:10px 12px;border-radius:9px;border-color:#d5dbe3;background:#fff;color:var(--text)}
.field input:focus,.field textarea:focus,.field select:focus,.toolbar input:focus,.toolbar select:focus{
  border-color:var(--primary);box-shadow:var(--ring);outline:none}
.field textarea{min-height:104px;line-height:1.75}
.field input::placeholder,.field textarea::placeholder{color:#98a2b3}
.form-grid{gap:20px}
.service-selector{border-radius:12px;padding:14px 18px;box-shadow:var(--shadow-sm)}
.service-selector label{font-size: 13px;color:var(--text-2)}
.toolbar{margin-bottom:16px}
.segment{background:#eef1f0;border-radius:10px}
.segment button{font-size:13px;padding:8px 14px;border-radius:8px;color:#5d6b7a}
.segment button.active{color:var(--primary-strong);font-weight:600}

/* 表格：字号提升、表头吸顶、操作列固定右侧、窄屏横滑 */
.table-wrap{overflow:auto;border-radius:0 0 var(--radius) var(--radius);overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-gutter:stable}
table{font-size: 13px;min-width:960px}
th,td{vertical-align:middle}
th{position:sticky;top:0;z-index:1;background:#f8faf9;color:var(--text-2);font-size: 12px;font-weight:600;padding:12px 18px}
td{padding:14px 18px;color:#344054;line-height:1.6}
tbody tr:hover{background:#f7faf9}
td strong{color:var(--text);font-weight:600}
td small{font-size: 12px;color:var(--muted)}
.row-actions{white-space:nowrap}
/* 行内次要操作收进“⋯”菜单：主操作保持可见，避免按钮挤成一片误点 */
.row-menu{position:relative;display:inline-block;margin-left:6px}
.row-menu>summary{list-style:none;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;
  width:30px;height:30px;border:1px solid #dde3e8;border-radius:8px;color:#5d6b7a;font-size:15px;line-height:1}
.row-menu>summary::-webkit-details-marker{display:none}
.row-menu>summary:hover{background:#f2f5f4;color:#1f2a33}
.row-menu[open]>summary{background:#eaf2ed;border-color:#cfe0d5;color:var(--primary-strong)}
/* 必须用 fixed：表格容器是 overflow:auto，绝对定位会被裁掉 */
.row-menu>div{position:fixed;right:auto;z-index:120;display:flex;flex-direction:column;gap:6px;
  min-width:132px;padding:8px;background:#fff;border:1px solid #e3e8ec;border-radius:10px;
  box-shadow:0 10px 28px rgba(20,32,44,.12)}
.row-menu>div .button{width:100%;justify-content:flex-start}
/* 最后一列是 position:sticky，本身就形成层叠上下文，
   菜单会跟着被困在里面、被下一行的单元格盖住。打开时把所属单元格抬起来。 */
.table-wrap td.menu-open { z-index:130; }
.row-actions button{font-size:13px;padding:6px 10px;border-radius:6px;color:var(--primary-strong);min-height:32px}
.row-actions button.danger{color:var(--danger)}
.table-wrap th:last-child,.table-wrap td:last-child{position:sticky;right:0;background:var(--surface);box-shadow:-10px 0 12px -12px rgba(16,24,40,.28)}
.table-wrap th:last-child{background:#f8faf9}
.table-wrap tbody tr:hover td:last-child{background:#f7faf9}
.table-footer{font-size: 12px;color:var(--muted);padding:12px 18px}
.table-footer .actions .button{min-height:34px}
.empty{padding:56px 24px;color:var(--muted)}
.empty strong{font-size:16px;color:var(--text-2)}
.empty p{font-size: 13px}
.detail-item{background:#f7f9f8;border-radius:9px;padding:13px 15px}
.detail-item small{font-size: 12px;color:var(--muted)}
.detail-item p{font-size: 13px;color:var(--text-2)}
.tag-list{gap:6px}

/* 弹窗、提示 */
dialog{width:min(760px,calc(100vw - 32px));border-radius:16px;box-shadow:0 32px 90px rgba(16,24,40,.24)}
.dialog-header{padding:20px 24px}
.dialog-header h2{font-size:20px}
.dialog-body{padding:22px 24px;font-size:14px}
.dialog-footer{padding:16px 24px;gap:10px;background:#fafbfa}
.dialog-footer>span{font-size: 12px;color:var(--muted)}
.toast-area{top:82px;right:24px}
.toast{font-size: 13px;padding:12px 16px;border-radius:10px;box-shadow:var(--shadow-md)}
.loading{font-size: 13px;color:var(--muted);gap:10px}

/* 登录 */
.login-card{padding:36px;border-radius:20px;gap:12px}
.login-card h1{font-size:28px}
.login-card p{font-size:14px;color:var(--muted)}
.login-card label{font-size: 13px}
.login-card input{font-size:15px;padding:12px 13px;border-radius:10px}

/* 提示词编辑区 */
.prompt-editor{font-size: 13px;line-height:1.85;border-radius:10px}
.prompt-preview{font-size:13px;line-height:1.85;border-radius:10px}
.prompt-variable{padding:12px;border-radius:9px}
.prompt-variable code{font-size: 12px}
.prompt-variable small{font-size:12px}
.prompt-layout{gap:20px;grid-template-columns:minmax(0,1fr) 320px}
.rule-input{font-size:14px;line-height:1.85}
.rule-help{font-size:13px}

@media(min-width:1550px){main{padding:36px 44px}}
@media(max-width:1150px){
  :root{--sidebar:230px}
  main{padding:26px 22px}.topbar{padding:0 22px}
  .prompt-layout{grid-template-columns:minmax(0,1fr)}
  table{min-width:900px}
}
@media(max-width:800px){
  :root{--sidebar:0px}
  .sidebar{width:264px;padding:20px 14px 0}
  .topbar{height:62px;padding:0 16px}
  main{padding:20px 16px 36px}
  .page-heading h1{font-size:25px}
  .page-heading p{font-size:13px;max-width:100%}
  .stat-value{font-size:28px}
  .panel-body{padding:18px}
  .panel-header{padding:16px 18px}
  .hero{padding:22px}
  .hero h2{font-size:22px}
  .table-wrap{position:relative}
  .table-wrap:after{content:"左右滑动查看全部列 →";display:block;padding:8px 18px;font-size:12px;color:var(--muted);background:#fbfcfb;border-top:1px dashed var(--line)}
  table{min-width:900px}
  .row-actions button{min-height:36px;padding:8px 10px}
  .toast-area{top:70px;right:12px;left:12px;max-width:none}
  .footer{font-size:12px;padding:16px}
}
@media(max-width:480px){
  .page-heading{flex-direction:column;gap:14px;align-items:stretch}
  .page-heading .actions{width:100%}
  .page-heading .actions .button{flex:1}
  .quick-grid{grid-template-columns:1fr}
  .stats-grid{gap:12px}
  .stat{padding:16px}
  .stat-value{font-size:26px}
  .dialog-header,.dialog-body,.dialog-footer{padding-left:16px;padding-right:16px}
  .service-selector{padding:14px}
}

/* 设备对话（后台调试用）：左侧对话流 + 底部输入 */
.device-chat-status{display:flex;align-items:center;gap:8px;margin-bottom:12px;flex-wrap:wrap}
.device-chat-log{display:flex;flex-direction:column;gap:10px;max-height:46vh;overflow-y:auto;padding:4px 2px}
.device-chat-line{display:flex;flex-direction:column;gap:4px;max-width:86%}
.device-chat-line.user{align-self:flex-end;align-items:flex-end}
.device-chat-line.sys{align-self:center;align-items:center}
.device-chat-bubble{padding:9px 13px;border-radius:10px;background:#f2f7f4;font-size:13px;line-height:1.55;white-space:pre-wrap;word-break:break-word}
.device-chat-line.user .device-chat-bubble{background:var(--primary);color:#fff}
.device-chat-line.sys .device-chat-bubble{background:transparent;color:#8a9a91;font-size:11px;padding:2px 6px}
.device-chat-line.error .device-chat-bubble{background:#fdeeee;color:#b45656}
.device-chat-meta{font-size:11px;color:#7d8d84;font-family:ui-monospace,Menlo,monospace}
/* 工具返回的图片：跟在气泡下面，双列小图，点开看大图 */
.device-chat-images{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:6px;margin-top:6px;max-width:340px}
.device-chat-images a{display:block;text-decoration:none}
.device-chat-images img{display:block;width:100%;height:96px;object-fit:cover;border-radius:8px;background:#eef2ef}
.device-chat-images span{display:block;margin-top:2px;font-size:11px;color:#7d8d84;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.device-chat-form{display:flex;gap:8px;width:100%}
.device-chat-form input{flex:1;padding:9px 12px;border:1px solid var(--line);border-radius:8px;font-size:13px}
