/* 在线客服工作台 · 极简清爽双栏排版 */

body[data-page="service"] { background: #f5f7fb; }

.cs-workspace { padding: 26px 0 56px; }
.cs-container { max-width: 1120px; }
.cs-layout { display: grid; grid-template-columns: minmax(0, 1fr) 268px; gap: 20px; align-items: start; }

/* 主对话卡 */
.cs-chat { background: #fff; border: 1px solid #e5eaf3; border-radius: 14px; overflow: hidden; box-shadow: 0 6px 24px rgba(15, 23, 42, .04); }
.cs-chat-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid #eef2f8; }
.cs-chat-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cs-chat-title h1 { font-size: 16px; font-weight: 700; color: var(--text); margin: 0; line-height: 1.3; }
.cs-engine-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: #eef4ff; color: var(--blue); }
.cs-engine-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #10b981; }
.cs-engine-badge.is-fallback { background: #f1f5f9; color: #475569; }
.cs-engine-badge.is-fallback::before { background: #2563ff; }
.cs-quota-badge { font-size: 11.5px; color: var(--muted); }
.cs-chat-actions { display: flex; gap: 8px; flex-shrink: 0; }
.cs-bar-btn { display: inline-flex; align-items: center; justify-content: center; height: 30px; padding: 0 12px; border-radius: 7px; border: 1px solid #e2e8f0; background: #fff; color: var(--text-sub); font-size: 12.5px; font-weight: 500; text-decoration: none; cursor: pointer; transition: border-color .15s, color .15s; }
.cs-bar-btn:hover { border-color: var(--blue); color: var(--blue); }
.cs-bar-btn--primary { border-color: #c7dafc; background: #f4f8ff; color: var(--blue); }
.cs-bar-btn--primary:hover { background: var(--blue); border-color: var(--blue); color: #fff; }

/* 紧凑分段业务场景条 */
.cs-scenes { display: flex; align-items: center; gap: 6px; padding: 10px 20px; background: #fafcff; border-bottom: 1px solid #eef2f8; overflow-x: auto; }
.cs-scene-btn { flex: none; border: 0; background: transparent; color: #64748b; font-size: 12.5px; font-weight: 500; padding: 5px 12px; border-radius: 7px; cursor: pointer; transition: background .15s, color .15s; }
.cs-scene-btn:hover { background: #eef4ff; color: var(--blue); }
.cs-scene-btn.is-active { background: var(--blue); color: #fff; font-weight: 600; }

/* 消息列表 */
.cs-messages { height: 470px; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; background: #fff; }
.cs-msg { display: flex; align-items: flex-start; gap: 10px; }
.cs-msg-user { flex-direction: row-reverse; }
.cs-avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; background: #eef4ff; color: var(--blue); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.cs-msg-user .cs-avatar { background: #f1f5f9; color: #475569; }
.cs-bubble { max-width: 78%; padding: 11px 15px; border-radius: 12px; background: #f6f8fc; font-size: 13.5px; color: var(--text); line-height: 1.65; overflow-wrap: anywhere; }
.cs-msg-user .cs-bubble { background: var(--blue); color: #fff; }
.cs-bubble p { margin: 0 0 6px; }
.cs-bubble p:last-child { margin-bottom: 0; }
.cs-bubble ul, .cs-bubble ol { margin: 6px 0; padding-left: 18px; display: grid; gap: 3px; }
.cs-bubble code { background: rgba(37, 99, 255, .09); color: #1e40af; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.cs-msg-user .cs-bubble code { background: rgba(255, 255, 255, .2); color: #fff; }

.cs-citations { margin-top: 8px; padding-top: 8px; border-top: 1px solid #e6ecf5; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cs-citations strong { font-size: 11.5px; color: var(--muted); }
.cs-citations a { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 5px; background: #fff; border: 1px solid #e2e8f0; color: var(--blue); font-size: 11.5px; text-decoration: none; }
.cs-citations a:hover { border-color: var(--blue); }

.cs-bubble .cs-link { display: inline-block; margin-top: 8px; color: var(--blue); font-weight: 600; font-size: 12.5px; text-decoration: none; }
.cs-bubble .cs-link:hover { text-decoration: underline; }
.cs-feedback { display: flex; gap: 6px; margin-top: 8px; padding-top: 7px; border-top: 1px dashed #e2e8f0; font-size: 11.5px; color: var(--muted); align-items: center; }
.cs-feedback button { border: 1px solid #e2e8f0; background: #fff; color: var(--text-sub); border-radius: 5px; padding: 2px 8px; font-size: 11.5px; cursor: pointer; }
.cs-feedback button:hover { border-color: var(--blue); color: var(--blue); }

.cs-typing { color: var(--text-sub); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.cs-typing-dots span { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--blue); opacity: .35; animation: csPulse 1.1s infinite ease-in-out; }
.cs-typing-dots span:nth-child(2) { animation-delay: .18s; }
.cs-typing-dots span:nth-child(3) { animation-delay: .36s; }
@keyframes csPulse { 0%, 80%, 100% { opacity: .25; transform: scale(.85); } 40% { opacity: 1; transform: scale(1.1); } }

/* 快捷提问 */
.cs-quick { padding: 10px 20px; border-top: 1px solid #eef2f8; background: #fcfdff; }
.cs-quick-list { display: flex; flex-wrap: wrap; gap: 7px; }
.cs-quick-list button { border: 1px solid #e2e8f0; background: #fff; color: #475569; font-size: 12px; padding: 5px 11px; border-radius: 999px; cursor: pointer; transition: all .15s; }
.cs-quick-list button:hover { border-color: var(--blue); color: var(--blue); background: #f4f8ff; }

/* 输入栏 */
.cs-input { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid #eef2f8; background: #fff; }
.cs-input input { flex: 1; min-width: 0; border: 1px solid #dce4f0; border-radius: 8px; padding: 10px 14px; font-size: 13.5px; color: var(--text); outline: 0; }
.cs-input input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 255, .08); }
.cs-input button { border: 0; background: var(--blue); color: #fff; font-size: 13.5px; font-weight: 600; padding: 0 22px; border-radius: 8px; cursor: pointer; }
.cs-input button:hover:not(:disabled) { background: var(--blue-dark); }
.cs-input button:disabled { opacity: .6; cursor: not-allowed; }

/* 精简右侧栏（仅 2 张卡） */
.cs-side { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 16px; }
.cs-side-card { min-width: 0; background: #fff; border: 1px solid #e5eaf3; border-radius: 14px; padding: 16px 18px; }
.cs-side-card h2 { font-size: 14px; font-weight: 700; color: var(--text); margin: 0 0 12px; }
.cs-muted-txt { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin: 0; }

.cs-account-box { display: grid; gap: 10px; }
.cs-side-btns { display: grid; gap: 8px; }
.cs-side-btns .btn { width: 100%; font-size: 13px; padding: 8px 12px; text-align: center; }
.cs-side-login-link { border: 0; background: transparent; padding: 2px 0 0; color: var(--blue); font-size: 12px; text-align: left; cursor: pointer; }
.cs-side-login-link:hover { text-decoration: underline; }

.cs-account-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--text-sub); }
.cs-account-head a { color: var(--blue); font-size: 12px; text-decoration: none; }
.cs-account-head a:hover { text-decoration: underline; }
.cs-mini-tickets { display: grid; gap: 7px; }
.cs-mini-ticket { display: block; padding: 8px 10px; border: 1px solid #e8edf5; border-radius: 8px; text-decoration: none; background: #fafcff; }
.cs-mini-ticket:hover { border-color: var(--blue); }
.cs-mini-ticket-title { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-mini-ticket-meta { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--muted); }
.cs-mini-st { font-weight: 600; color: #b45309; }
.cs-mini-st.is-processing { color: var(--blue); }
.cs-mini-st.is-resolved { color: #047857; }
.cs-mini-st.is-closed { color: #64748b; }
.cs-side-sublinks { display: flex; justify-content: space-between; padding-top: 4px; font-size: 12px; }
.cs-side-sublinks a { color: var(--blue); text-decoration: none; }
.cs-side-sublinks a:hover { text-decoration: underline; }

/* 单行紧凑热门文档 */
.cs-hot-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.cs-hot-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid #f1f5f9; }
.cs-hot-row:last-child { border-bottom: 0; }
.cs-hot-ask { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0; text-align: left; font-size: 12.5px; color: var(--text); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-hot-ask:hover { color: var(--blue); }
.cs-hot-raw { flex: none; font-size: 11.5px; color: var(--muted); text-decoration: none; }
.cs-hot-raw:hover { color: var(--blue); }
.cs-side-more { display: inline-block; margin-top: 10px; font-size: 12px; color: var(--blue); text-decoration: none; }
.cs-side-more:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .cs-layout { grid-template-columns: 1fr; }
  .cs-messages { height: 420px; }
}
@media (max-width: 640px) {
  .cs-workspace { padding: 14px 0 36px; }
  .cs-messages { height: 380px; padding: 16px; }
  .cs-chat-bar, .cs-scenes, .cs-quick, .cs-input { padding-left: 14px; padding-right: 14px; }
  .cs-bubble { max-width: 88%; }
}
