
[hidden]{display:none!important}input,select,button,textarea{font:inherit}input,textarea,select{max-width:100%}.desk{max-width:1180px;margin:auto;padding:0 44px 64px}.desk-header{display:flex;align-items:center;justify-content:space-between;padding:30px 0;border-bottom:1px solid var(--line)}.desk-header .back-link{margin:0;padding:0}.desk-intro{padding:52px 0 38px}.desk-intro h1{font-family:"Songti SC",SimSun,serif;font-weight:500;font-size:44px;line-height:1.4;letter-spacing:1px;margin:12px 0 18px}.desk-intro h1 em{font-style:normal;color:var(--teal)}.desk-intro p{color:var(--muted);margin:0;line-height:1.9}.compact{padding:34px 0}.compact h1{font-size:36px}.desk-grid{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(270px,1fr);gap:24px;align-items:start}.panel{border:1px solid var(--line);background:#fff;border-radius:12px;padding:26px;margin-bottom:22px}.panel h2{font-size:18px;margin:0 0 16px;line-height:1.5;overflow-wrap:anywhere}.panel-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}.step{font-size:11px;color:var(--muted);white-space:nowrap}.panel label{display:block;font-size:13px;font-weight:600;margin:18px 0 7px}.panel input:not([type=checkbox]),.panel textarea{display:block;width:100%;border:1px solid #cdd8d1;border-radius:7px;padding:11px 12px;background:#fcfdfb;color:var(--ink)}.panel textarea{resize:vertical;min-height:90px}.panel input:focus,.panel textarea:focus{outline:2px solid #a6c8b9;outline-offset:1px}.muted,.form-help{color:var(--muted);font-size:12px;font-weight:400}.form-help{margin:9px 0 18px;line-height:1.8}.privacy-box{padding:14px 16px;background:#f1f4ee;border-radius:7px;font-size:12px;color:#58675b;line-height:1.9;margin:22px 0}.primary,.secondary{border:1px solid var(--teal);border-radius:7px;padding:10px 16px;font-size:13px;line-height:1.6}.primary{background:var(--teal);color:white}.primary:hover{background:#105b4f}.secondary{background:white;color:var(--teal)}button:disabled{opacity:.5;cursor:default}.text-button{border:0;background:transparent;color:var(--teal);padding:4px 0;font-size:12px}.form-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:18px}.check{display:flex!important;gap:9px;align-items:flex-start}.check input{margin-top:5px;accent-color:var(--teal)}details{font-size:12px;color:var(--muted);margin:10px 0 18px}summary{cursor:pointer;color:var(--teal)}.prewrap{white-space:pre-wrap;overflow-wrap:anywhere}.ticket-list{display:grid;gap:9px}.ticket-item{display:block;width:100%;text-align:left;border:1px solid var(--line);border-radius:8px;padding:13px;background:var(--paper);color:var(--ink)}.ticket-item:hover,.ticket-item.selected{border-color:var(--teal);background:#f0f6f0}.ticket-item strong{display:block;font-size:13px;overflow-wrap:anywhere}.ticket-meta{font-size:11px;color:var(--muted);display:flex;justify-content:space-between;gap:8px;margin-top:9px}.badge{font-size:11px;border-radius:20px;padding:3px 10px;background:#eef4ed;color:var(--teal);white-space:nowrap}.thread-message{padding:16px 0;border-top:1px solid var(--line)}.thread-message.staff{border-left:3px solid var(--teal);padding:15px;background:#f4f7f1;border-radius:4px;margin:14px 0}.thread-label{font-size:12px;color:var(--muted);display:flex;justify-content:space-between;gap:10px}.thread-message p{font-size:14px;white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0}.recovery{background:#eff5ed;border-color:#c7dac7}.recovery input{font-family:monospace;font-size:12px;margin-bottom:12px}.aside-note{font-size:12px;color:var(--muted);padding:0 10px}.empty-state{font-size:13px;color:var(--muted);padding:22px 0;text-align:center}.notice{position:sticky;bottom:18px;margin:0;background:#eaf3ea;color:#204d3d;border-radius:8px;padding:13px 18px;font-size:13px;box-shadow:0 4px 20px #192d3512;white-space:pre-wrap}.notice:empty{display:none}.notice.error{background:#fdf0e9;color:#8a3b20}.staff-toolbar{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-bottom:24px}.staff-toolbar select{border:1px solid var(--line);padding:8px;border-radius:6px;background:white}.staff-grid{grid-template-columns:minmax(240px,1fr) minmax(0,1.8fr)}.login-panel{max-width:430px}.login-panel .primary{margin-top:22px}#ticket-view{scroll-margin-top:25px}#renew-code{margin-top:18px}@media(max-width:760px){.desk{padding:0 18px 30px}.desk-header{padding:22px 0}.desk-intro{padding:30px 0 24px}.desk-intro h1{font-size:34px}.desk-grid,.staff-grid{grid-template-columns:minmax(0,1fr)}.panel{padding:20px}.brand{font-size:17px}.desk-intro p{font-size:13px}.staff-toolbar{gap:10px}.notice{bottom:10px}.thread-label{flex-wrap:wrap}}

.notice{position:static;margin:18px 0 0;box-shadow:none}.notice:empty{display:none}

#account-login-link{display:inline-block;text-decoration:none}#account-current{overflow-wrap:anywhere}

.chat-image{display:block;max-width:100%;width:auto;max-height:420px;object-fit:contain;border-radius:8px;margin:10px 0}.image-panel img{max-height:220px}.upload-button{display:inline-block;margin:8px 0}.image-panel button:disabled{opacity:.5;cursor:default}
.panel input.sr-only{position:absolute;width:1px;height:1px;padding:0;border:0;margin:-1px;clip:rect(0,0,0,0);overflow:hidden}
/* 客服工作台（样稿 A「紧凑两栏」，2026-11-24）。只作用于 body[data-staff="true"]：用户留言页是 data-staff="false"，不受影响。
   颜色取全站主题层（graphite）的变量，深色模式跟着 html[data-tf-theme=dark] 切换；没有主题层时用括号里的浅色值。 */
html body[data-staff="true"]{--sd-surface:var(--surface,#fff);--sd-soft:var(--soft,#eff1f4);--sd-hover:var(--hover,#e8ebf0);--sd-bg:var(--bg,#f7f8fa);--sd-accent:var(--accent,#994c2f);--sd-quiet:#878d97;--sd-accent-soft:#f6ece7;--sd-accent-line:#e6cdbf;--sd-warn:#9a5b0b;--sd-warn-soft:#fbf0dc;--sd-ok:#2b7353;--sd-ok-soft:#e3f2ea;--sd-bad:#ad3529;--sd-bad-soft:#fbe8e5;--sd-shadow:0 1px 2px rgb(16 18 22 / .05);background:var(--sd-bg);color:var(--ink)}
html[data-tf-theme=dark] body[data-staff="true"]{--sd-quiet:#7b818b;--sd-accent-soft:#231a15;--sd-accent-line:#4a3326;--sd-warn:#e0b565;--sd-warn-soft:#2a2214;--sd-ok:#7fd1a8;--sd-ok-soft:#12251c;--sd-bad:#f0a097;--sd-bad-soft:#2d1916;--sd-shadow:none}

/* 页头 */
html body[data-staff="true"] .staff-top{display:flex;align-items:center;justify-content:space-between;gap:16px;height:58px;padding:0 28px;border-bottom:1px solid var(--line);background:var(--sd-surface)}
html body[data-staff="true"] .staff-top .brand{display:flex;align-items:center;gap:10px;font-size:15px;font-weight:600;letter-spacing:-.3px;line-height:1.3;color:var(--ink)}
html body[data-staff="true"] .staff-top .brand small{display:inline;margin:0 0 0 9px;padding-left:9px;border-left:1px solid var(--line);font-size:13px;font-weight:400;letter-spacing:0;color:var(--muted)}
html body[data-staff="true"] .staff-top .brand-mark{width:28px;height:28px;padding:0;border-radius:6px;display:grid;place-items:center;font:700 13px/1 'DM Sans',sans-serif;letter-spacing:-.5px}
html body[data-staff="true"] .staff-top .back-link{margin:0;padding:0;font-size:13px;color:var(--muted);white-space:nowrap}
html body[data-staff="true"] .staff-top .back-link:hover{color:var(--ink)}
html body[data-staff="true"] .staff-wrap{max-width:1240px;margin:0 auto;padding:20px 28px 88px}

/* 提示条和登录卡片 */
html body[data-staff="true"] .notice{margin:0 0 14px;padding:10px 14px;border:0;border-radius:8px;font-size:13px;background:var(--sd-ok-soft);color:var(--sd-ok)}
html body[data-staff="true"] .notice.error{background:var(--sd-bad-soft);color:var(--sd-bad)}
html body[data-staff="true"] .login-panel{max-width:440px;margin:48px auto;padding:26px 28px;border:1px solid var(--line);border-radius:12px;background:var(--sd-surface);box-shadow:var(--sd-shadow);color:var(--ink);text-align:center}
html body[data-staff="true"] .login-panel p{margin:0 0 14px}
html body[data-staff="true"] #staff-login-link{display:inline-block;border-radius:7px;padding:8px 18px;font-size:13px;font-weight:600;background:var(--ink);color:var(--sd-bg)}
html body[data-staff="true"] #staff-retry{border:1px solid var(--line);border-radius:7px;padding:7px 14px;font-size:13px;background:var(--sd-surface);color:var(--ink)}

/* 状态标签和刷新 */
html body[data-staff="true"] .staff-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 16px;flex-wrap:nowrap}
html body[data-staff="true"] .status-tabs{display:inline-flex;gap:2px;max-width:100%;overflow-x:auto;padding:3px;border:1px solid var(--line);border-radius:9px;background:var(--sd-soft)}
html body[data-staff="true"] .status-tab{display:inline-flex;align-items:center;gap:7px;border:0;border-radius:7px;padding:5px 12px;font-size:13px;line-height:1.6;white-space:nowrap;background:transparent;color:var(--muted);box-shadow:none}
html body[data-staff="true"] .status-tab:hover:not(:disabled){background:var(--sd-hover);color:var(--ink)}
html body[data-staff="true"] .status-tab[aria-pressed="true"]{background:var(--sd-surface);color:var(--ink);font-weight:600;box-shadow:var(--sd-shadow)}
html body[data-staff="true"] .status-tab .n{font-size:12px;color:var(--sd-quiet);font-variant-numeric:tabular-nums}
html body[data-staff="true"] .status-tab .n:empty{display:none}
html body[data-staff="true"] .status-tab .n.hot{color:var(--sd-warn);font-weight:600}
html body[data-staff="true"] .refresh-button{display:inline-flex;align-items:center;gap:6px;flex-shrink:0;border:1px solid var(--line);border-radius:7px;padding:5px 11px;font-size:13px;line-height:1.6;background:var(--sd-surface);color:var(--ink)}

/* 两栏 */
html body[data-staff="true"] .staff-grid{display:grid;grid-template-columns:340px minmax(0,1fr);gap:18px;align-items:start}
html body[data-staff="true"] .ticket-column{position:sticky;top:16px;padding:6px;border:1px solid var(--line);border-radius:12px;background:var(--sd-soft)}
html body[data-staff="true"] .ticket-list{display:grid;gap:2px}
html body[data-staff="true"] .ticket-item{display:grid;grid-template-columns:8px minmax(0,1fr);align-items:center;column-gap:10px;row-gap:2px;width:100%;margin:0;border:0;border-radius:8px;padding:11px 12px;text-align:left;background:transparent;color:var(--ink);box-shadow:none}
html body[data-staff="true"] .ticket-item:hover:not(:disabled){background:var(--sd-hover);color:var(--ink)}
html body[data-staff="true"] .ticket-item.selected,html body[data-staff="true"] .ticket-item.selected:hover:not(:disabled){background:var(--sd-surface);box-shadow:inset 3px 0 0 var(--sd-accent),var(--sd-shadow)}
html body[data-staff="true"] .ticket-item strong{grid-column:2;grid-row:1;font-size:14px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html body[data-staff="true"] .ticket-meta{display:contents}
html body[data-staff="true"] .ticket-state{grid-column:1;grid-row:1;width:8px;height:8px;border-radius:50%;overflow:hidden;font-size:0;background:var(--sd-quiet)}
html body[data-staff="true"] .ticket-item[data-status="pending"] .ticket-state{background:var(--sd-warn)}
html body[data-staff="true"] .ticket-item[data-status="replied"] .ticket-state{background:var(--sd-ok)}
html body[data-staff="true"] .ticket-meta>span:last-child{grid-column:2;grid-row:2;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
html body[data-staff="true"] .ticket-meta>span.late{color:var(--sd-warn);font-weight:600}
html body[data-staff="true"] .empty-state{margin:0;padding:26px 12px;border:0;background:transparent;color:var(--sd-quiet);font-size:13px;text-align:center}
html body[data-staff="true"] .pager{display:flex;justify-content:center;gap:8px;margin:0;padding:8px 4px 4px}
html body[data-staff="true"] .pager .secondary{border:1px solid var(--line);border-radius:7px;padding:5px 12px;font-size:12px;background:var(--sd-surface);color:var(--ink)}

/* 留言详情 */
html body[data-staff="true"] #ticket-view{margin:0;padding:22px 24px 18px;border:1px solid var(--line);border-radius:12px;background:var(--sd-surface);box-shadow:var(--sd-shadow);color:var(--ink)}
html body[data-staff="true"] .back-to-list{display:none}
html body[data-staff="true"] #ticket-view .panel-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin:0 0 18px;padding-bottom:16px;border-bottom:1px solid var(--line)}
html body[data-staff="true"] #ticket-title{margin:0;font-size:19px;line-height:1.45;font-weight:600;letter-spacing:-.4px;overflow-wrap:anywhere;color:var(--ink)}
html body[data-staff="true"] .ticket-contact{display:flex;flex-wrap:wrap;gap:6px 14px;margin:6px 0 0;font-size:13px;color:var(--muted)}
html body[data-staff="true"] .ticket-contact b{font-weight:500;color:var(--ink);overflow-wrap:anywhere}
html body[data-staff="true"] #ticket-status{flex-shrink:0;border-radius:999px;padding:2px 10px;font-size:12px;font-weight:600;white-space:nowrap;background:var(--sd-soft);color:var(--muted)}
html body[data-staff="true"] #ticket-status[data-status="pending"]{background:var(--sd-warn-soft);color:var(--sd-warn)}
html body[data-staff="true"] #ticket-status[data-status="replied"]{background:var(--sd-ok-soft);color:var(--sd-ok)}
html body[data-staff="true"] #ticket-context-wrap{margin:0 0 16px;padding:9px 14px;border:1px dashed var(--line);border-radius:10px;background:transparent;font-size:13px;color:var(--muted)}
html body[data-staff="true"] #ticket-context-wrap summary{cursor:pointer;color:var(--ink);font-weight:500}
html body[data-staff="true"] #ticket-context{margin:8px 0 2px;line-height:1.7}

/* 对话：用户在左，客服在右 */
html body[data-staff="true"] .thread-message{max-width:min(78%,560px);margin:0 0 16px;padding:0;border:0;border-radius:0;background:transparent}
html body[data-staff="true"] .thread-message.staff{margin-left:auto}
html body[data-staff="true"] .thread-label{display:flex;justify-content:flex-start;align-items:center;gap:8px;margin:0 2px 5px;font-size:12px;color:var(--muted)}
html body[data-staff="true"] .thread-message.staff .thread-label{justify-content:flex-end}
html body[data-staff="true"] .thread-label strong{font-weight:600;color:var(--ink)}
html body[data-staff="true"] .bubble{padding:10px 14px;border:1px solid var(--line);border-radius:4px 12px 12px 12px;background:var(--sd-soft)}
html body[data-staff="true"] .thread-message.staff .bubble{border-color:var(--sd-accent-line);border-radius:12px 4px 12px 12px;background:var(--sd-accent-soft)}
html body[data-staff="true"] .bubble p{margin:0;font-size:14px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}
html body[data-staff="true"] .bubble p:empty{display:none}
html body[data-staff="true"] .bubble .chat-image{margin:8px 0 2px;max-height:360px}
html body[data-staff="true"] .bubble p:empty+.chat-image{margin-top:0}
html body[data-staff="true"] .bubble .form-help{margin:6px 0 0;font-size:12px;color:var(--muted)}
html body[data-staff="true"] .mail-status{display:flex;justify-content:flex-end;align-items:center;gap:6px;margin-top:5px;font-size:12px;color:var(--muted)}
html body[data-staff="true"] .mail-status::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
html body[data-staff="true"] .mail-status[data-state="sent"]{color:var(--sd-ok)}
html body[data-staff="true"] .mail-status[data-state="review"]{color:var(--sd-warn)}
html body[data-staff="true"] .mail-status[data-state="undeliverable"]{color:var(--sd-bad)}

/* 回复框 */
html body[data-staff="true"] .staff-composer{margin:8px 0 0;border:1px solid var(--line);border-radius:12px;background:var(--sd-surface);box-shadow:var(--sd-shadow)}
html body[data-staff="true"] .staff-composer:focus-within{border-color:var(--sd-accent-line);box-shadow:0 0 0 3px var(--sd-accent-soft)}
html body[data-staff="true"] .staff-composer textarea{display:block;width:100%;min-height:74px;margin:0;border:0;border-radius:12px 12px 0 0;padding:12px 14px 4px;resize:vertical;font-size:14px;line-height:1.7;background:transparent;color:var(--ink);outline:none;box-shadow:none}
html body[data-staff="true"] .staff-composer textarea::placeholder{color:var(--sd-quiet)}
html body[data-staff="true"] .staff-composer .image-panel{margin:4px 14px 0;padding:10px;border:1px solid var(--line);border-radius:10px;background:var(--sd-soft)}
html body[data-staff="true"] .staff-composer .image-panel-header{display:flex;justify-content:space-between;align-items:center;font-size:12px;color:var(--muted)}
html body[data-staff="true"] .staff-composer .remove-image{border:0;padding:2px 4px;font-size:12px;background:transparent;color:var(--sd-bad)}
html body[data-staff="true"] .staff-composer .image-preview{display:block;max-width:100%;max-height:180px;margin-top:8px;border-radius:8px}
html body[data-staff="true"] .staff-composer .image-note{margin:6px 0 0;font-size:12px;color:var(--muted)}
html body[data-staff="true"] .staff-composer-bar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:8px 10px 10px}
html body[data-staff="true"] .staff-composer .attach-button{display:inline-flex;align-items:center;gap:6px;margin:0;padding:6px 8px;border-radius:6px;font-size:13px;font-weight:400;color:var(--muted);cursor:pointer}
html body[data-staff="true"] .staff-composer .attach-button:hover{background:var(--sd-hover);color:var(--ink)}
html body[data-staff="true"] .staff-composer-hint{margin-right:auto;font-size:12px;color:var(--sd-quiet)}
html body[data-staff="true"] .staff-composer .secondary{border:1px solid var(--line);border-radius:7px;padding:7px 14px;font-size:13px;line-height:1.5;background:var(--sd-surface);color:var(--ink)}
html body[data-staff="true"] .staff-composer .primary{border:0;border-radius:7px;padding:8px 16px;font-size:13px;line-height:1.5;font-weight:600;background:var(--ink);color:var(--sd-bg)}
html body[data-staff="true"] .staff-composer .primary:hover:not(:disabled){background:var(--ink);color:var(--sd-bg);filter:brightness(.9)}
html body[data-staff="true"] .staff-composer .secondary:hover:not(:disabled){background:var(--sd-hover);color:var(--ink)}
html body[data-staff="true"] .ticket-id{margin:12px 0 0;font:12px/1.6 'SF Mono',Consolas,monospace;letter-spacing:0;color:var(--sd-quiet)}
html body[data-staff="true"] .ticket-id:empty{display:none}
html body[data-staff="true"] #select-hint{margin:0;padding:60px 20px;border:1px dashed var(--line);border-radius:12px;background:transparent;color:var(--sd-quiet)}

/* 手机：点开一条留言后整屏看对话 */
@media (max-width:760px){
  html body[data-staff="true"] .staff-top{height:52px;padding:0 14px}
  html body[data-staff="true"] .opt{display:none}
  html body[data-staff="true"] .staff-wrap{padding:12px 12px 88px}
  html body[data-staff="true"] .staff-toolbar{gap:8px}
  html body[data-staff="true"] .status-tabs{flex:1;min-width:0}
  html body[data-staff="true"] .status-tab{padding:5px 10px}
  html body[data-staff="true"] .refresh-button{padding:7px 9px}
  html body[data-staff="true"] .staff-grid{grid-template-columns:minmax(0,1fr)}
  html body[data-staff="true"] .ticket-column{position:static}
  html body[data-staff="true"].ticket-open .ticket-column{display:none}
  html body[data-staff="true"]:not(.ticket-open) .detail-column{display:none}
  html body[data-staff="true"] #ticket-view{padding:14px 14px 12px}
  html body[data-staff="true"] .back-to-list{display:inline-flex;align-items:center;gap:6px;margin:0 0 12px;padding:0;border:0;font-size:13px;background:transparent;color:var(--muted);box-shadow:none}
  html body[data-staff="true"] #ticket-view .panel-heading{flex-direction:column;gap:8px}
  html body[data-staff="true"] .thread-message{max-width:88%}
  html body[data-staff="true"] .staff-composer-hint{display:none}
}
