:root{color-scheme:light;--ink:#1f2329;--muted:#8f959e;--line:#dee0e3;--green:#1664ff;--paper:#ffffff}
*{box-sizing:border-box}body{font-family:Inter,"Microsoft YaHei","PingFang SC",sans-serif;font-size:14px;color:var(--ink);background:var(--paper);margin:0;padding-left:196px;line-height:1.55}button,input,select,textarea{font:inherit}button{color:var(--ink);background:white;border:1px solid var(--line);border-radius:7px;padding:7px 12px;margin:3px;transition:background .15s}button:hover{background:#f2f3f5}button:disabled{cursor:wait;opacity:.55}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid #1664ff;outline-offset:2px}input,select,textarea{border:1px solid var(--line);border-radius:7px;background:white;padding:8px;color:var(--ink)}button[type=submit],.summary-confirm{background:var(--green);border-color:var(--green);color:white}h1,h2,h3,h4{letter-spacing:.02em}h1{font-size:26px;font-weight:600;margin:0}h2{font-size:18px}h3{font-size:17px}small,.source{color:var(--muted)}
#appNav{position:fixed;left:0;top:0;bottom:0;width:196px;background:#1f2329;color:#1f2329;padding:28px 16px;display:flex;flex-direction:column;z-index:5}.brand{display:flex;align-items:center;gap:10px;padding:0 8px 26px;font-size:19px;font-weight:600}.brand-mark{background:#e8f0ff;color:#1f2329;border-radius:9px;width:35px;height:35px;display:grid;place-items:center;font-size:17px}.nav-section{font-size:11px;color:#8f959e;padding:20px 12px 6px;letter-spacing:.14em}#appNav button{background:transparent;color:#8f959e;border:0;text-align:left;margin:3px 0;width:100%;padding:10px 12px;display:flex;align-items:center;gap:10px}#appNav button:hover,#appNav button.active{background:#e8f0ff;color:white}#appNav button.active{box-shadow:inset 3px 0 #1664ff}.nav-glyph{display:inline-grid;place-items:center;width:23px;font-size:13px;font-weight:600}.nav-count{margin-left:auto;border-radius:10px;padding:0 6px;background:#b91c1c;color:white;font-size:11px;min-width:20px;text-align:center}.nav-bottom{margin-top:auto}.nav-version{font-size:10px;color:#8f959e;padding:15px 12px 0}#statusBar{position:fixed;bottom:18px;left:215px;z-index:30;background:#fff7d6;border:1px solid #f5d78e;border-radius:8px;padding:10px 16px;max-width:650px;box-shadow:0 4px 18px #1f232915;cursor:pointer}
#home{max-width:1500px;padding:34px 36px;margin:auto}.page-heading{display:flex;align-items:center;justify-content:space-between;margin:0 0 26px}.eyebrow{font-size:12px;color:var(--muted);margin:0 0 6px}.refresh-status{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:8px}.refresh-status::before{content:"";width:6px;height:6px;border-radius:50%;background:#1664ff}.conversation-overview{max-width:none}.home-section-title{border:0;padding:0;font-size:16px;margin:26px 0 14px;font-weight:600}.source-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.source-card{aspect-ratio:auto;min-height:210px;align-items:stretch;justify-content:flex-start;border:1px solid var(--line);padding:20px;gap:13px;border-radius:12px;box-shadow:0 3px 10px #1f232903}.source-card h2{font-size:20px;margin:0}.source-card>.source-metrics{font-size:12px;color:var(--muted)}.source-card>.pending-badge{position:static;background:transparent;color:var(--ink);height:auto;border-radius:0;padding:0;justify-content:flex-start;font-size:13px}.source-controls{max-width:none;gap:5px;margin-top:auto}.source-control{border-top:1px solid #f2f3f5;padding-top:7px}.source-control button{padding:4px 10px;min-width:50px}.control-label{font-size:11px;white-space:normal}.source-control button[aria-pressed=true]{color:#1664ff}.source-controls>button{font-size:11px;margin:2px 0 0;padding:4px;background:#fff;color:#1664ff}.other-source{width:auto;display:inline-flex;gap:15px;padding:8px 12px;font-size:12px;border:1px solid var(--line);margin:12px 8px 0 0}.other-source .pending-badge{position:static;height:20px;min-width:20px;font-size:11px}#otherSource>.slot-entry{margin:12px 8px 0 0}#monitorStatus{margin-top:30px}.monitor-row{border:1px solid var(--line);margin:0;border-radius:0;padding:14px 12px;font-size:12px}.monitor-head{background:#f5f6f7;color:#8f959e;border-radius:8px 8px 0 0;font-size:11px}.monitor-row:last-child{border-radius:0 0 8px 8px}.monitor-row.paused{background:#f5f6f7;color:#8f959e}.monitor-row.ok .monitor-state{color:#1664ff}.monitor-row.bad{border-color:#dc2626;background:#fee2e2}.monitor-row button{font-size:11px}.monitor-account button{display:block!important;color:var(--green);background:transparent;border:0;padding:0;text-align:left}.monitor-account strong{display:none}.monitor-alert{background:#fff7d6;color:#8f6400;border:1px solid #f5d78e;font-size:13px;font-weight:500}.monitor-meta{font-size:11px;margin:12px 0}.monitor-details-json{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;max-height:65vh;overflow:auto}
#l{margin:28px;background:white;border:1px solid var(--line);border-radius:12px;min-height:calc(100vh - 56px);overflow:hidden}#listHeader{position:sticky;top:0;background:#ffffff;border-bottom:1px solid var(--line);padding:14px;flex-wrap:wrap}#listHeader h2{font-size:17px;flex-basis:55%}#accountFilter{display:flex;flex-wrap:wrap;align-items:center;gap:7px;padding:12px 16px;border-bottom:1px solid var(--line);background:#ffffff;font-size:12px}#accountFilter select{max-width:100%;font-size:12px;padding:5px;flex:1}.conversation{padding:16px;border-color:#dee0e3;gap:12px;position:relative}.conversation:hover,.conversation.selected{background:#e8f0ff}.conversation.selected{box-shadow:inset 3px 0 #1664ff}.conversation .avatar{width:38px;height:38px;border-radius:12px;background:#f2f3f5;color:#1664ff;font-size:15px}.conversation-title strong{font-weight:600}.conversation .source{font-size:10px;color:#8f959e}.conversation .summary{font-size:12px;color:#8f959e}.conversation-time{font-size:10px}.pending{color:#8f6400;background:#f5f6f7;padding:1px 6px;border-radius:4px;font-size:10px;display:inline-block;margin-top:5px}.unread-badge{background:#b91c1c;color:white;border-radius:10px;padding:0 6px;font-size:10px;margin-left:auto;min-width:18px;text-align:center}.account-label{font-size:10px;color:#8f959e;margin-bottom:2px}.extras-summary{display:none}.list-total{font-size:11px;color:var(--muted)}
body[data-view=chat] #l{display:block;position:fixed;left:196px;top:0;bottom:0;width:300px;margin:0;border-width:0 1px 0 0;border-radius:0;overflow-y:auto;min-height:0}body[data-view=chat] #listHeader{top:0;z-index:2;padding:12px}body[data-view=chat] #listHeader h2{font-size:15px}body[data-view=chat] #listHeader button{font-size:10px;padding:4px 7px}body[data-view=chat] #l .conversation{padding:14px 12px}body[data-view=chat] #l .source{font-size:10px}body[data-view=chat] #l .avatar{width:30px;height:30px;border-radius:9px}#c{margin-left:300px;min-height:100vh;background:#f5f6f7}#header{padding:18px 24px;min-height:96px;background:#ffffff;border-bottom:1px solid var(--line);top:0;z-index:3;flex-wrap:nowrap;gap:10px}#header .header-info{flex-basis:auto}#header .header-info>strong{font-size:18px}#header .avatar{border-radius:12px;background:#f2f3f5;width:40px;height:40px}#header button{font-size:11px;padding:6px 10px}#header .source{font-size:10px}#header>button:first-child{display:none}#chatBody{padding:12px 12px 0}#messages{min-height:calc(100vh - 225px);padding-bottom:16px}.m{margin:18px 12px;gap:8px}.m .avatar{width:28px;height:28px;font-size:12px;border-radius:9px;background:#f2f3f5}.message-name{font-size:10px}.bubble{max-width:min(500px,95%);background:white;border:1px solid #dee0e3;border-radius:0 10px 10px;padding:11px 14px;font-size:13px;line-height:1.7}.s .bubble{background:#e8f0ff;border-color:#dee0e3;border-radius:10px 0 10px 10px}.m .body{min-width:0;max-width:85%}.m .source,.m small{font-size:9px}.internal .bubble{background:#f5f6f7;color:#8f959e;font-size:11px}.summary-message-action{padding:1px 6px;font-size:10px;margin:4px 0 0;color:#8f959e;border:0;background:transparent}.d{background:#ffffff;border:1px solid #f5d78e;border-radius:8px;font-size:13px;padding:16px;margin:16px 12px}.d>small{font-size:10px;color:#8f959e}.d::first-line{font-weight:500}.draft-actions{justify-content:flex-end;gap:6px;margin-top:10px}.draft-actions button{flex:none;font-size:11px;margin:0}.draft-actions button:first-child{background:var(--green);color:white;border-color:var(--green)}.draft-basis{background:#f5f6f7;font-size:10px;padding:8px;border-radius:4px}.image-candidates img{max-height:240px;object-fit:contain}.draft-group{color:#8f959e;font-size:11px}#send{padding:12px;background:#ffffff;border-color:var(--line);margin:0 -12px;z-index:2;align-items:center}#send textarea{height:52px;min-height:52px;resize:vertical;font-size:13px;background:#ffffff}#send button{font-size:11px;white-space:nowrap;padding:7px 10px;margin:0}#send>button[type=submit]{background:var(--green);color:white;border:0}#commandPanel{background:#f5f6f7;padding:14px;border-radius:8px;margin:12px 0}#commandPanel small{display:block;font-size:11px}.command-result{background:#f5f6f7;border:1px solid #dee0e3;border-radius:8px;font-size:12px}.command-result:empty{display:none}
#profilePanel{margin:0;padding:20px;background:#ffffff;border-radius:0;min-height:0;border-bottom:1px solid var(--line);font-size:12px}#profilePanel h3{font-size:13px;margin:0 0 12px}#profilePanel>.source{font-size:10px;margin-bottom:14px}.profile-fields{grid-template-columns:60px minmax(0,1fr);gap:9px;font-size:12px}.extra-fields{font-size:11px}.summary-card{background:#f5f6f7}.summary-card button{font-size:10px}.summary-card small{font-size:10px}.summary-hint{font-size:11px}.summary-card p{font-size:12px}.source>button{font-size:10px;padding:2px 5px}
dialog{padding:25px;border:1px solid var(--line);border-radius:12px;box-shadow:0 18px 90px #1f232940;max-height:90vh;overflow:auto}dialog::backdrop{background:#1f232970;backdrop-filter:blur(3px)}dialog input,dialog select{font-size:13px}dialog textarea{font-size:13px;line-height:1.7;resize:vertical}dialog h3{font-size:19px;font-weight:600;margin-bottom:12px}.dialog-actions{margin-top:20px}.slot-dialog{width:1000px;max-width:92vw}.slot-table{font-size:12px}.slot-table th{color:var(--muted);font-weight:500}.slot-table input,.slot-table select{width:125px}.slot-table input[data-field=note]{width:155px}.autoreply-dialog{width:1000px;max-width:92vw}.autoreply-account{background:#ffffff;border-color:var(--line);font-size:12px}.autoreply-step{background:#ffffff;border-color:var(--line)}.autoreply-step-tools{font-size:12px}.autoreply-step-tools button{font-size:11px}.autoreply-editor{border-color:var(--line)}.autoreply-on{background:var(--green);color:white}.autoreply-bar strong{font-size:13px}.auth-dialog{width:400px}.auth-dialog label{display:block;font-size:12px;margin:18px 0}.auth-dialog input{width:100%;margin-top:6px}.auth-dialog p{font-size:12px;color:var(--muted)}#authStatus{color:#b91c1c;min-height:20px}#imagePreview{background:#1f2329ee;overflow:hidden;touch-action:none}#imagePreview img{position:absolute;inset:0;transform-origin:center;cursor:grab;user-select:none}#imageTools{position:absolute;top:16px;right:16px;display:flex;gap:6px;z-index:2}#imageTools button{background:#ffffffe8;border:0;font-size:12px}.voice-hint{font-size:11px;color:var(--muted);margin-left:6px}.empty{font-size:13px;padding:28px}
#swapCandidates button{display:block;width:100%;margin:10px 0;text-align:left;padding:12px}#swapCandidates img{display:block;width:100%;max-height:280px;object-fit:contain;margin-bottom:8px}
.autoreply-dialog[open] {
    display: flex;
    flex-direction: column;
    width: 1120px;
    max-width: 94vw;
    height: 88vh;
    overflow: hidden;
    padding: 24px 28px;
}
.autoreply-dialog > .autoreply-bar { flex-shrink: 0; }
.autoreply-dialog h3 { margin: 0; }
.autoreply-controls {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    border: 0;
    padding: 0;
    margin: 0;
}
.autoreply-global-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    flex-shrink: 0;
}
.autoreply-global-card p { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.autoreply-global-card button { flex-shrink: 0; }
.autoreply-repeat { flex-shrink: 0; padding: 12px 0 8px; }
.autoreply-settings-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.autoreply-settings-row button { margin: 0; }
.autoreply-repeat label, .autoreply-whitelist summary { font-size: 13px; font-weight: 600; }
.autoreply-repeat p { margin: 6px 0 0; color: var(--muted); }
.autoreply-whitelist { flex-shrink: 0; border: 1px solid var(--line); border-radius: 8px; background: #ffffff; }
.autoreply-whitelist summary { cursor: pointer; padding: 10px 14px; }
#autoreplyWhitelistCount { font-weight: 400; color: var(--muted); }
.autoreply-whitelist-content { padding: 0 14px 12px; max-height: 220px; overflow-y: auto; }
.autoreply-whitelist-content > p { margin: 0 0 10px; }
#autoreplyWhitelistForm label { font-size: 12px; display: flex; align-items: center; gap: 6px; }
#autoreplyWhitelistForm input { width: 155px; max-width: 100%; }
.autoreply-whitelist-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12px; overflow-wrap: anywhere; }
.autoreply-whitelist-item:last-child { border-bottom: 0; }
.autoreply-whitelist-item > .autoreply-settings-row { flex-shrink: 0; }
.autoreply-global-card.is-enabled, .autoreply-account.is-enabled {
    background: #e8f0ff;
    border-color: #dee0e3;
}
.autoreply-global-card.is-enabled strong, .autoreply-account.is-enabled .autoreply-account-state {
    color: #1664ff;
}
.autoreply-tabs {
    display: flex;
    gap: 22px;
    margin-top: 14px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}
.autoreply-tabs button {
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    padding: 12px 2px;
    margin: 0;
    background: transparent;
    color: var(--muted);
}
.autoreply-tabs button[aria-selected=true] { border-bottom-color: var(--green); color: var(--green); font-weight: 600; }
.autoreply-controls > [role=tabpanel] {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 8px 12px 0;
    margin: 0;
    border: 0;
}
.autoreply-controls > [role=tabpanel][hidden] { display: none; }
.autoreply-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.autoreply-metrics > div { border: 1px solid var(--line); border-radius: 9px; padding: 16px 20px; }
.autoreply-metrics strong { display: block; font-size: 28px; font-weight: 600; }
.autoreply-metrics span { font-size: 12px; color: var(--muted); }
.autoreply-policies, .autoreply-account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.autoreply-policy { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 9px; }
.autoreply-policy strong { overflow-wrap: anywhere; }
.autoreply-policy p { margin: 5px 0 0; }
.autoreply-policy button { flex-shrink: 0; }
.autoreply-account { border-radius: 9px; padding: 18px; margin: 0; }
.autoreply-account > strong { font-size: 16px; }
.autoreply-account .autoreply-bar { justify-content: flex-start; margin: 14px 0 0; }
.autoreply-account select { flex-basis: 100%; width: 100%; }
.autoreply-account-state { font-weight: 600; padding: 8px 0; }
.autoreply-account .autoreply-status { flex-basis: 100%; font-size: 11px; }
.autoreply-step { padding: 18px; border-radius: 9px; margin: 0 0 14px; }
.autoreply-step-title { margin-right: auto; }
.autoreply-step-tools { gap: 8px; }
.autoreply-step-tools input { width: 82px; }
.autoreply-delay-origin { margin: 8px 0 0; }
.autoreply-step textarea { width: 100%; }

.autoreply-alts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; align-items: stretch; }
.autoreply-alt { padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #ffffff; box-sizing: border-box; }
.autoreply-alt.is-image { flex: 0 1 auto; }
.autoreply-alt.is-text { flex: 1 1 100%; padding: 8px 12px; }
.autoreply-alt-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 12px; }
.autoreply-alt.is-text .autoreply-alt-head { margin: 0; }
.autoreply-alt-head strong { margin-right: auto; }
.autoreply-alt-head button { margin: 0; font-size: 11px; padding: 6px 9px; }
.autoreply-alt.is-text textarea { flex: 1; min-width: 0; min-height: 40px; margin: 0; width: auto; }
.autoreply-alt img { display: block; max-width: 180px; max-height: 150px; margin: 0 0 8px; }
.autoreply-alt .autoreply-status { display: block; margin-top: 6px; }
.autoreply-add-alts { margin-top: 10px; }
.autoreply-add-alts button { margin: 0 8px 0 0; }
.autoreply-rotate-hint { margin: 8px 0 0; }
.autoreply-preview { margin: 8px 0 0; padding: 14px 18px; border: 1px solid var(--line); border-radius: 9px; background: #ffffff; }
.autoreply-preview h4 { margin: 0 0 6px; }
.autoreply-preview ol { margin: 4px 0 0; padding-left: 22px; font-size: 13px; line-height: 1.6; }
#autoreplyForm > label { display: block; margin: 12px 0; }
#autoreplyName { display: block; width: 100%; max-width: 480px; margin-top: 6px; }
.autoreply-refresh-hint { margin: 12px 0 0; font-size: 11px; }
#autoreplyStatus { margin: 6px 0 0; }
#autoreplyStatus:empty { display: none; }
@media (max-width: 800px) {
    .autoreply-dialog[open] { padding: 16px; height: 92vh; }
    .autoreply-global-card { flex-wrap: wrap; gap: 8px; padding: 12px; }
    .autoreply-policies, .autoreply-account-grid { grid-template-columns: minmax(0, 1fr); }
    .autoreply-metrics { gap: 8px; }
    .autoreply-metrics > div { padding: 12px; }
    .autoreply-metrics strong { font-size: 23px; }
    .autoreply-step-title { flex-basis: 100%; }
}
.account-cards{flex-basis:100%;display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px;margin-top:8px}.account-card{padding:10px 12px;background:white;border:1px solid var(--line);border-radius:8px;display:flex;flex-direction:column;align-items:flex-start;gap:4px}.account-card>button{padding:0;border:0;background:transparent;color:var(--green);font-weight:600;text-align:left}.account-card .source{font-size:11px;overflow-wrap:anywhere}body[data-view=chat] .account-cards{display:none}
@media(min-width:1450px){#c{padding-right:290px}#profilePanel{display:block!important;position:fixed;top:96px;bottom:0;right:0;width:290px;overflow:auto;border-left:1px solid var(--line);border-bottom:0}#chatBody{display:block!important}#header{margin-right:-290px}#profileToggle{display:none}}
@media(max-width:1150px){body{padding-left:165px}#appNav{width:165px;padding:24px 10px}.brand{font-size:17px;padding-left:5px}.source-grid{grid-template-columns:repeat(2,minmax(0,1fr))}body[data-view=chat] #l{left:165px;width:255px}#c{margin-left:255px}#home{padding:28px 24px}#header{padding:14px;flex-wrap:wrap}#header .header-info{flex-basis:70%}#send{flex-wrap:wrap}#send textarea{flex-basis:100%}#statusBar{left:180px}}
@media(max-width:800px){body{padding-left:0;padding-top:62px}#appNav{width:100%;height:62px;bottom:auto;padding:8px 12px;flex-direction:row;align-items:center;overflow:auto;gap:7px}.brand{padding:0;font-size:0}.brand-mark{width:32px;height:32px;font-size:15px}.nav-section,.nav-version{display:none}.nav-bottom{margin:0}#appNav button{width:auto;white-space:nowrap;font-size:11px;margin:0;padding:8px}.nav-glyph{display:none}#home{padding:22px 16px}.page-heading{align-items:flex-start}.refresh-status{font-size:10px}h1{font-size:23px}.source-grid{gap:10px}.source-card{padding:14px;min-height:195px}#l{margin:12px;min-height:calc(100vh - 86px)}body[data-view=chat] #l{display:none!important}#c{margin-left:0}#header{top:62px;min-height:90px}#header>button:first-child{display:block}#header .header-info{flex-basis:auto}#profileToggle{display:block}.m .body{max-width:88%}.bubble{max-width:100%}.monitor-head{display:none}.monitor-row{font-size:11px}.monitor-account button{font-size:11px}#statusBar{left:12px;right:12px;bottom:12px;max-width:none;font-size:12px}}

.douyin-account-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 12px; }
.douyin-account-card { padding: 16px; background: white; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.douyin-account-card > strong { font-size: 14px; display: block; overflow-wrap: anywhere; margin-bottom: 8px; }
.account-type-label { display: inline-block; font-size: 11px; padding: 3px 8px; border-radius: 5px; background: #f2f3f5; color: #1664ff; margin: 4px 0; }
.autoreply-account > .account-type-label { margin-left: 10px; }
.account-toggle-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.account-toggle-row button { margin: 0; font-size: 11px; padding: 6px 9px; }
.strategy-capability-warning { flex-basis: 100%; font-size: 12px; background: #fff7d6; border: 1px solid #f5d78e; color: #8f6400; padding: 9px 11px; border-radius: 5px; }
.autoreply-bootstrap-notice { flex-shrink: 0; font-size: 12px; padding: 10px 12px; margin: 10px 0 0; background: #fff7d6; border-radius: 6px; color: #8f6400; }
.autoreply-global-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.template-profile-editor { margin: 10px 0; padding: 10px; border: 1px solid var(--line); border-radius: 6px; }
.template-profile-editor summary { cursor: pointer; font-size: 12px; }
.template-profile-editor label { display: block; margin: 10px 0; font-size: 12px; }
.template-profile-editor textarea { min-height: 100px; margin-top: 6px; }
.template-profile-editor input[type=number] { width: 68px; margin-left: 6px; }
.template-slot-row { display: flex; gap: 5px; flex-wrap: wrap; margin: 7px 0; }
.template-slot-row input { width: 68px; min-width: 0; }
.template-slot-row input[data-slot-field=wechat] { flex: 1; min-width: 90px; }
.template-slot-row button { font-size: 11px; padding: 3px 6px; margin: 0; }

/* Keep operational counts, switch states and panel boundaries easy to scan. */
:root {
    --ink: #1f2329;
    --line: #dee0e3;
    --green: #1664ff;
}
h1, h2, h3, h4, .home-section-title {
    color: #1f2329;
    font-weight: 700;
}
.source-card, .account-card, .autoreply-account, .autoreply-global-card,
.autoreply-policy, .autoreply-metrics > div, .autoreply-whitelist, .autoreply-step {
    border-color: #dee0e3;
}
.source-control { border-top-color: #dee0e3; }
.source-card > .pending-badge {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    background: transparent;
}
.count-metric {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    white-space: nowrap;
}
.metric-value {
    display: inline-block;
    min-width: 1.15em;
    font-size: 28px;
    font-weight: 750;
    line-height: 1.25;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.metric-label { font-size: 12px; font-weight: 500; }
.count-metric.is-active .metric-value { color: #b91c1c; }
.count-metric.is-active .metric-label { color: #7f1d1d; }
.count-metric.is-zero { color: #8f959e; }
.count-metric.is-zero .metric-value { font-weight: 500; }
.other-source .metric-value, #accountFilter .metric-value { font-size: 18px; }
.account-metrics { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; }
.unread-badge, .nav-count {
    background: #b91c1c;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    min-width: 22px;
    padding: 1px 7px;
}
.pending {
    color: #b91c1c;
    background: #fee2e2;
    font-size: 13px;
    font-weight: 700;
    padding: 2px 7px;
}
button[aria-pressed] { white-space: nowrap; }
.monitor-action button[aria-pressed] { padding-inline: 7px; }
button[aria-pressed="true"],
.source-control button[aria-pressed="true"],
.monitor-row button[aria-pressed="true"],
.autoreply-on {
    background: #1664ff;
    border: 1px solid #1664ff;
    color: #fff;
    font-weight: 700;
}
button[aria-pressed="false"],
.source-control button[aria-pressed="false"],
.monitor-row button[aria-pressed="false"] {
    background: #e5e7eb;
    border: 1px solid #9ca3af;
    color: #374151;
    font-weight: 600;
}
button[aria-pressed="true"]:hover,
.source-control button[aria-pressed="true"]:hover,
.monitor-row button[aria-pressed="true"]:hover { background: #1664ff; color: #fff; }
button[aria-pressed="false"]:hover,
.source-control button[aria-pressed="false"]:hover,
.monitor-row button[aria-pressed="false"]:hover { background: #d1d5db; color: #1f2937; }
.monitor-row.ok .monitor-state { color: #1664ff; font-weight: 750; }
.monitor-row.bad {
    color: #7f1d1d;
    background: #fee2e2;
    border-color: #dc2626;
}
.monitor-row.bad .monitor-state { color: #b91c1c; font-weight: 750; }
.monitor-row.bad .monitor-heartbeat small { color: #9f3030; }
.monitor-row.bad .monitor-account button { color: #991b1b; }
.monitor-row .monitor-account button { background: transparent; }
.monitor-row.paused .monitor-account button { color: #6b7280; }
.monitor-head { color: #1f2329; background: #f5f6f7; }
.monitor-alert {
    color: #991b1b;
    background: #fee2e2;
    border-color: #dc2626;
    font-weight: 700;
}
.autoreply-global-card.is-enabled, .autoreply-account.is-enabled { border-color: #1664ff; }

/* Blue-white service console palette. All geometry comes from the existing rules. */
#appNav {
    background: #fff;
    color: #1f2329;
    box-shadow: inset -1px 0 #dee0e3;
}
#appNav button { color: #1f2329; }
#appNav button:hover { background: #f5f6f7; color: #1664ff; }
#appNav button.active { background: #e8f0ff; color: #1664ff; }
.brand-mark { background: #e8f0ff; color: #1664ff; }
a, .video-download, .info-section > summary { color: #1664ff; }
input, select, textarea { accent-color: #1664ff; }
button[type=submit], .summary-confirm, #autoreplySave, #autoreplyRepeatSave,
#autoreplyApplyGlobal, #autoreplyOverviewNew, #autoreplyNew {
    background: #1664ff;
    border-color: #1664ff;
    color: #fff;
}
button[type=submit]:hover, .summary-confirm:hover, #autoreplySave:hover,
#autoreplyRepeatSave:hover, #autoreplyApplyGlobal:hover,
#autoreplyOverviewNew:hover, #autoreplyNew:hover,
button[aria-pressed="true"]:hover,
.source-control button[aria-pressed="true"]:hover,
.monitor-row button[aria-pressed="true"]:hover { background: #0e54df; color: #fff; }
.count-metric.is-active .metric-label { color: #1f2329; }
.count-metric.is-active[data-count-kind="pending"] .metric-value { color: #1664ff; }
.pending { background: #e8f0ff; color: #1664ff; }
.control-label, .summary-hint, .autoreply-status, .conversation .summary,
.monitor-heartbeat small, .monitor-details { color: #8f959e; }
.monitor-head, .slot-table th { background: #f5f6f7; color: #1f2329; }
.d { background: #fff; }
.draft-basis, .draft-group { color: #8f959e; }

.selfcheck-panel { margin: 0 0 28px; padding: 22px 24px; background: #fff; border: 1px solid var(--line); border-radius: 12px; scroll-margin-top: 20px; }
.selfcheck-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.selfcheck-heading h2 { font-size: 18px; margin: 0; }
.selfcheck-heading p { color: var(--muted); font-size: 12px; margin: 5px 0 0; }
.selfcheck-heading button { margin: 0; flex-shrink: 0; color: #1664ff; border-color: #1664ff; }
.selfcheck-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; margin: 18px 0 14px; font-size: 12px; color: var(--muted); }
.selfcheck-summary strong { color: var(--ink); font-size: 14px; }
.selfcheck-summary strong.has-warning { color: #b91c1c; }
#selfcheckUpdated { margin-left: auto; font-size: 11px; }
.selfcheck-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.selfcheck-row { position: relative; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #f5f6f7; }
.selfcheck-row[data-status=missing] { border-color: #dc2626; background: #fff8f8; }
.selfcheck-row-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.selfcheck-customer { font-size: 14px; overflow-wrap: anywhere; }
.selfcheck-status { color: #6b7280; background: #e5e7eb; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 4px; flex-shrink: 0; }
[data-status=missing] .selfcheck-status { color: #b91c1c; background: #fee2e2; }
.selfcheck-identity { color: var(--muted); font-size: 11px; margin: 4px 0 12px; overflow-wrap: anywhere; }
.selfcheck-reason { color: var(--ink); font-size: 13px; font-weight: 600; margin: 0 0 5px; }
[data-status=missing] .selfcheck-reason { color: #991b1b; }
.selfcheck-detail { margin: 0 0 10px; color: #6b7280; font-size: 12px; overflow-wrap: anywhere; }
.selfcheck-meta { font-size: 10px; color: var(--muted); margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.selfcheck-meta span { display: block; margin-top: 2px; }
.selfcheck-open { padding: 2px 0; margin: 9px 0 0; font-size: 11px; color: #1664ff; background: transparent; border: 0; }
.selfcheck-error { color: #991b1b; background: #fee2e2; border: 1px solid #dc2626; border-radius: 6px; padding: 10px 12px; font-size: 12px; }
.selfcheck-empty { grid-column: 1 / -1; margin: 0; padding: 14px 0 4px; color: var(--muted); font-size: 13px; }
@media (max-width: 1000px) { .selfcheck-rows { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 800px) { .selfcheck-panel { padding: 16px; scroll-margin-top: 76px; } .selfcheck-heading { gap: 8px; } .selfcheck-heading button { font-size: 11px; padding: 5px 8px; } #selfcheckUpdated { width: 100%; margin-left: 0; } }

.selfcheck-alert { display: block; width: 100%; box-sizing: border-box; text-align: left; cursor: pointer; margin: 0 0 16px; font: inherit; }
.selfcheck-alert:hover { filter: brightness(0.98); }
.selfcheck-row[data-status=acknowledged] { background: #f5f6f7; border-color: var(--line); }
.selfcheck-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 9px; }
.selfcheck-ack { font-size: 11px; padding: 2px 8px; margin: 0; color: #991b1b; background: #fff; border: 1px solid #dc2626; border-radius: 4px; }
.selfcheck-ack:hover { background: #fee2e2; }
.selfcheck-open { margin-top: 0; }
.selfcheck-recent { margin: 8px 0 0; padding: 6px 8px; background: #fff; border: 1px solid var(--line); border-radius: 4px; font-size: 11px; line-height: 1.5; color: var(--muted); }
.selfcheck-recent-line { display: flex; align-items: flex-start; gap: 4px; overflow-wrap: anywhere; }
.selfcheck-recent-side { flex-shrink: 0; }
.selfcheck-recent-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); cursor: zoom-in; }

.account-metrics > button.count-metric {
    padding: 0 2px;
    border: 0;
    background: transparent;
    margin: 0;
    cursor: pointer;
    border-radius: 7px;
    color: inherit;
}
.account-metrics > button.count-metric:hover { background: #f2f3f5; }
.account-metrics > button.count-metric:disabled { cursor: default; opacity: 1; }
.account-unread-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}
.account-unread-actions .mark-all-read {
    margin: 0;
    padding: 4px 10px;
    font-size: 12px;
    white-space: nowrap;
}
.account-card.is-unread-filter {
    background: #e8f0ff;
    box-shadow: inset 3px 0 #1664ff;
}
.conversation-content { flex: 0 1 380px; }
.conversation .selfcheck-recent {
    margin: 0;
    padding: 0 8px;
    background: transparent;
    border: 0;
    border-radius: 0;
    flex: 1 1 260px;
    min-width: 0;
    max-height: 72px;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.3;
    color: var(--muted);
}
.conversation .selfcheck-recent-thumb {
    width: 16px;
    height: 16px;
}
