.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-line { display: flex !important; align-items: center; gap: 8px; }
.form .check-line input { width: auto; margin: 0; }
.field-grid .check-line { margin-top: 27px; }
.rule-toolbar { display:flex; justify-content:space-between; align-items:center; margin:3px 0 12px; color:#7d8799; font-size:11px; }
.secondary { border:1px solid #dbe3f2; background:#f5f8ff; color:#3158aa; border-radius:7px; padding:8px 11px; font-size:11px; }
.secondary:hover { background:#e8efff; }
.rule-card { border:1px solid #e8ebf0; border-radius:8px; padding:13px; margin-bottom:9px; background:#fbfcfe; }
.rule-card { min-width:0; overflow:hidden; }
.rule-card-head { display:flex; justify-content:space-between; align-items:center; font-size:12px; }
.rule-keywords { color:#3158aa; font-size:13px; font-weight:700; margin-top:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rule-reply { color:#5e697a; font-size:12px; line-height:1.6; margin-top:6px; overflow:hidden; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.rule-actions { display:flex; gap:5px; margin-top:10px; }
.rule-actions button { border:0; background:transparent; color:#6d7890; font-size:11px; padding:4px 6px; border-radius:4px; }
.rule-actions button:hover { background:#edf2ff; color:#3158aa; }
.rule-actions .delete-link { color:#c15c5c; margin-left:auto; }
.rule-actions button:disabled { color:#c8ced8; cursor:not-allowed; }
.rule-empty { border:1px dashed #dce2eb; border-radius:8px; padding:22px 10px; color:#9aa4b3; text-align:center; font-size:12px; }
.bulk-bar { display:flex; align-items:center; gap:7px; padding:0 0 10px; color:#7d8799; font-size:11px; }
.bulk-bar b { color:#3158aa; }
.bulk-bar button { border:0; background:#f3f6fc; color:#526688; border-radius:5px; padding:6px 8px; font-size:10px; }
.bulk-bar button:hover { background:#e6edfc; color:#3158aa; }
.bulk-bar .delete-link { margin-left:auto; background:#fff0f0; color:#c15c5c; }
.select-rule { width:20px; height:20px; margin:0 8px 0 0 !important; display:inline-grid !important; place-items:center; }
.select-rule input { width:15px !important; height:15px; margin:0 !important; }
.rule-card-head { gap:3px; }
#rule-dialog label { display:block; color:#667287; font-size:12px; margin-bottom:16px; }
#rule-dialog input[name="keywords"], #rule-dialog textarea[name="reply"] { display:block; width:100%; margin-top:7px; border:1px solid #dfe5ee; border-radius:8px; padding:12px; font:inherit; font-size:13px; color:var(--ink); background:#fbfcfe; }
#rule-dialog textarea[name="reply"] { min-height:118px; resize:vertical; line-height:1.6; }
#rule-dialog input:focus, #rule-dialog textarea:focus { outline:0; border-color:#6f91e3; box-shadow:0 0 0 3px #eaf0ff; }
.switch input { display:none; }
.switch span { display:block; width:34px; height:19px; border-radius:12px; background:#cfd6e2; position:relative; cursor:pointer; }
.switch span:after { content:''; position:absolute; width:15px; height:15px; background:#fff; border-radius:50%; top:2px; left:2px; transition:.15s; box-shadow:0 1px 3px #aeb7c5; }
.switch input:checked + span { background:#3b70df; }.switch input:checked + span:after { left:17px; }
.rule-summary { display:flex; align-items:center; justify-content:space-between; gap:16px; border:1px solid #e1e8f4; border-radius:8px; padding:15px; margin:4px 0 16px; background:#f8faff; }
.rule-summary strong { display:block; color:#253858; margin:4px 0 2px; font-size:14px; }
.rule-summary p { margin:0; color:#7d8799; font-size:12px; }
#rules-dialog { width:min(760px, calc(100vw - 36px)); max-height:calc(100vh - 48px); padding:0; border:0; border-radius:10px; box-shadow:0 20px 60px #18233b3d; }
#rules-dialog::backdrop { background:#17203380; }
.rules-dialog-body { padding:24px; max-height:calc(100vh - 48px); overflow:auto; }
.rules-dialog-body .dialog-head { margin-bottom:18px; }
.rules-dialog-body .dialog-head p { margin:5px 0 0; color:#7d8799; font-size:12px; }
.rules-dialog-toolbar { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; color:#69778d; font-size:12px; }
.rules-dialog-toolbar strong { color:#3158aa; }
.rule-pagination { display:flex; justify-content:center; align-items:center; gap:12px; margin-top:16px; color:#768298; font-size:12px; }
.rule-pagination button { border:1px solid #dbe3f2; border-radius:6px; background:#fff; color:#4566a5; padding:7px 11px; font-size:12px; }
.rule-pagination button:disabled { color:#bbc3d0; border-color:#edf0f5; cursor:not-allowed; }
.logout-btn { padding:8px 10px; font-size:11px; }
#login-dialog { width:min(420px, calc(100vw - 36px)); }
#login-dialog .dialog-head p { margin:6px 0 0; color:#7d8799; font-size:12px; }
#login-dialog label { display:block; color:#667287; font-size:12px; margin-bottom:16px; }
#login-dialog input { display:block; width:100%; margin-top:7px; border:1px solid #dfe5ee; border-radius:8px; padding:12px; font:inherit; font-size:13px; color:var(--ink); background:#fbfcfe; }
#login-dialog input:focus { outline:0; border-color:#6f91e3; box-shadow:0 0 0 3px #eaf0ff; }
.login-error { min-height:18px; color:#c15c5c; font-size:12px; margin-bottom:6px; }
.sync-key-settings { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px; margin:2px 0 4px; border:1px solid #e1e8f4; border-radius:8px; background:#f8faff; }
.sync-key-settings strong { display:block; color:#253858; font-size:12px; }
.sync-key-settings small { display:block; margin-top:4px; color:#7d8799; font-size:11px; }
.field-hint { margin:-4px 0 14px; color:#9aa4b3; font-size:11px; line-height:1.5; }
#toast { position:fixed; left:50%; bottom:28px; z-index:20; transform:translate(-50%,12px); opacity:0; pointer-events:none; padding:11px 18px; border-radius:8px; color:#fff; background:#1f8f62; box-shadow:0 8px 24px #17203330; font-size:12px; transition:opacity .18s ease, transform .18s ease; }
#toast.show { opacity:1; transform:translate(-50%,0); }
#toast.error { background:#c94d5b; }
.knowledge-view { display:none; }
.knowledge-head-actions { display:flex; gap:8px; align-items:center; }
.knowledge-toolbar { display:flex; gap:8px; margin-bottom:16px; }
.knowledge-toolbar input { flex:1; border:1px solid #dfe5ee; border-radius:8px; padding:10px 12px; font:inherit; }
.knowledge-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.knowledge-card { min-width:0; border:1px solid #e8ebf0; border-radius:8px; padding:15px; background:#fbfcfe; }
.knowledge-card-head { display:flex; align-items:center; justify-content:space-between; }
.knowledge-card h4 { margin:12px 0 7px; color:#253858; font-size:14px; }
.knowledge-card p { color:#5e697a; font-size:12px; line-height:1.6; max-height:76px; overflow:hidden; white-space:pre-wrap; }
.knowledge-card small { color:#7d8799; display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.knowledge-actions { display:flex; gap:8px; margin-top:12px; }
.knowledge-actions button { border:0; background:#f3f6fc; color:#4566a5; border-radius:5px; padding:6px 9px; font-size:11px; }
.knowledge-actions .delete-link { color:#c15c5c; }
#knowledge-dialog { width:min(560px,calc(100vw - 36px)); }
#knowledge-dialog label { display:block; color:#667287; font-size:12px; margin-bottom:14px; }
#knowledge-dialog input, #knowledge-dialog select, #knowledge-dialog textarea { display:block; width:100%; margin-top:7px; border:1px solid #dfe5ee; border-radius:8px; padding:10px; font:inherit; font-size:13px; background:#fbfcfe; }
#knowledge-dialog textarea { min-height:150px; resize:vertical; line-height:1.6; }
@media (max-width: 760px) { .knowledge-list { grid-template-columns:1fr; } }
@media (max-width: 650px) { .field-grid { grid-template-columns: 1fr; gap: 0; } }
