/* 波塔·长随 · 普通用户工作台
   参考用户端工作台设计：蓝色主色、左侧用户导航、顶部用户栏、浅色卡片。 */
:root {
  --brand: #2f7cff;
  --brand-dark: #1f63e0;
  --brand-soft: #edf4ff;
  --bg: #f4f7fd;
  --paper: #ffffff;
  --ink: #17243b;
  --muted: #7e8aa3;
  --line: #e7edf7;
  --green: #20b26b;
  --orange: #e59a3d;
  --red: #d85353;
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.error { color: var(--red); font-size: 13px; margin: 8px 0; }
.eyebrow { display: block; font-size: 10px; letter-spacing: 2px; color: #7d93bb; font-weight: 700; }

.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 750; letter-spacing: -.8px; white-space: nowrap; }
.brand img { width: 34px; height: 34px; }
.brand span { font-weight: 400; color: var(--brand); }

.loading { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); background: var(--bg); }

/* ------------------------------------------------------------------ 登录 */

.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(400px, 1.05fr) minmax(430px, .95fr); }
.auth-story { padding: 44px 54px; background: linear-gradient(150deg, #eef5ff 0%, #dfeafe 100%); display: flex; flex-direction: column; overflow: hidden; }
.story-main { margin: auto 0; padding: 44px 0; }
.story-main h1 { font-size: 38px; line-height: 1.62; letter-spacing: -1px; margin: 20px 0; }
.story-main p { color: #7286a8; font-size: 14px; line-height: 2; }
.auth-story > small { font-size: 11px; color: #8296b8; }
.orbit { width: 232px; height: 172px; margin: 40px auto 0; position: relative; }
.orbit i { border: 1px solid rgba(116, 159, 226, .45); border-radius: 50%; width: 220px; height: 122px; position: absolute; top: 25px; left: 6px; transform: rotate(-30deg); }
.orbit i:nth-child(2) { transform: rotate(30deg); }
.orbit i:nth-child(3) { transform: rotate(90deg); }
.orbit span { position: absolute; inset: 51px 82px; display: grid; place-items: center; font-size: 30px; color: var(--brand); }
.auth-form-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 44px clamp(28px, 5vw, 72px); background: var(--bg); }
.auth-form { width: 100%; max-width: 385px; }
.auth-form h2 { font-size: 28px; margin-top: 12px; letter-spacing: -.5px; }
.auth-form > p { margin: 10px 0 26px; }
.auth-form label { display: grid; gap: 7px; font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.auth-form input { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 12px 14px; color: var(--ink); }
.auth-form input:focus { outline: 2px solid #c9ddff; border-color: #7ea7f5; }
.auth-switch { margin-top: 14px !important; text-align: center; }
.auth-switch button { background: none; border: 0; color: var(--brand-dark); font-size: 13px; padding: 4px; }
.auth-switch button:hover { text-decoration: underline; }
.qr-register { width: 100%; max-width: 385px; margin-top: 30px; border-top: 1px solid var(--line); padding-top: 22px; }
.divider { display: flex; align-items: center; gap: 12px; color: #9aa8c2; font-size: 12px; margin-bottom: 8px; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.register-hint { color: var(--ink); font-weight: 650; margin: 6px 0 12px; }
.dev-note { color: var(--muted); font-size: 12px; margin: 4px 0 10px; }
.row { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.row input { min-width: 150px; flex: 1; }
.qr-box { display: flex; gap: 18px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.qr-frame { width: 196px; height: 196px; border: 1px solid var(--line); border-radius: 14px; padding: 9px; background: #fff; display: flex; align-items: center; justify-content: center; }
.qr-frame img { width: 100%; height: 100%; object-fit: contain; }
.qr-state { font-weight: 650; color: var(--ink); }
.qr-state small { display: block; color: var(--muted); font-weight: 400; margin-top: 5px; line-height: 1.6; }

/* ------------------------------------------------------------- 工作台框架 */

.user-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.user-sidebar { background: #fff; border-right: 1px solid var(--line); padding: 22px 14px 18px; display: flex; flex-direction: column; min-height: 100vh; }
.user-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
.user-brand img { width: 38px; height: 38px; }
.user-brand span { display: grid; gap: 1px; }
.user-brand strong { font-size: 19px; letter-spacing: -.5px; }
.user-brand small { color: var(--muted); font-size: 10px; }
.user-nav { display: grid; gap: 4px; }
.user-nav-link { width: 100%; border: 0; background: none; color: #63708b; display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 10px; font-size: 14px; text-align: left; }
.user-nav-link:hover { background: #f3f7ff; color: var(--brand-dark); }
.user-nav-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.nav-icon { width: 20px; display: inline-grid; place-items: center; color: #6f83a8; font-size: 17px; }
.user-nav-toggle { justify-content: flex-start; }
.user-nav-toggle .nav-chevron { margin-left: auto; color: #9aa8c2; font-size: 12px; transition: transform .2s; }
.user-nav-group.open .nav-chevron { transform: rotate(180deg); }
.user-nav-sub { display: none; padding: 2px 0 5px 34px; }
.user-nav-group.open .user-nav-sub { display: grid; gap: 1px; }
.user-nav-sub a { color: #7d89a2; font-size: 13px; padding: 7px 8px; border-radius: 8px; }
.user-nav-sub a:hover, .user-nav-sub a.active { color: var(--brand); background: #f3f7ff; }
.user-sidebar-foot { margin-top: auto; background: linear-gradient(150deg, #eef5ff, #e6f0ff); border: 1px solid #dce9ff; border-radius: 14px; padding: 16px 15px; color: #5b76a5; font-size: 12px; line-height: 1.8; }
.user-sidebar-foot small { display: block; color: #8da1c3; margin-top: 6px; }
.user-workspace { min-width: 0; display: flex; flex-direction: column; }
.user-topbar { height: 74px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 28px; }
.breadcrumb { color: #9aa8c2; font-size: 13px; white-space: nowrap; }
.breadcrumb span { margin: 0 10px; color: #c4cfe2; }
.breadcrumb b { color: var(--ink); font-weight: 650; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.user-search { display: flex; align-items: center; gap: 8px; background: #f2f5fb; border-radius: 12px; padding: 9px 13px; width: clamp(220px, 26vw, 360px); color: #93a1ba; }
.user-search input { border: 0; outline: 0; background: transparent; width: 100%; color: var(--ink); }
.bell-button { position: relative; border: 0; background: #f5f8fd; width: 38px; height: 38px; border-radius: 50%; font-size: 16px; }
.bell-button i { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: #ff5a6a; border: 2px solid #fff; }
.user-menu { position: relative; display: flex; align-items: center; gap: 9px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #eaf2ff; color: var(--brand); font-weight: 700; }
.user-meta { display: grid; line-height: 1.25; }
.user-meta strong { font-size: 13px; }
.user-meta small { color: var(--green); font-size: 11px; display: flex; align-items: center; gap: 4px; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; }
#user-menu-toggle { border: 0; background: none; color: #8d9bb4; padding: 4px; }
.user-menu-dropdown { position: absolute; right: 0; top: 50px; z-index: 30; width: 180px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 50px rgba(39, 84, 160, .16); padding: 7px; }
.user-menu-dropdown button, .user-menu-dropdown a { display: block; width: 100%; text-align: left; border: 0; background: none; color: #5c6b86; padding: 10px 11px; border-radius: 8px; font-size: 13px; }
.user-menu-dropdown button:hover, .user-menu-dropdown a:hover { background: #f3f7ff; color: var(--brand); }
.dev-badge { font-size: 10px; letter-spacing: 1px; font-weight: 700; color: #8a5a14; background: #fff3d6; border: 1px solid #f0d69a; border-radius: 999px; padding: 4px 8px; }
.user-main { flex: 1; padding: 26px 28px 36px; }

/* --------------------------------------------------------------- 首页 */

.hero-banner { position: relative; overflow: hidden; border-radius: 18px; border: 1px solid #dbe8ff; background: linear-gradient(120deg, #eef6ff, #e4efff 58%, #dceaff); padding: 34px 36px; display: flex; align-items: center; justify-content: space-between; min-height: 220px; }
.hero-copy { position: relative; z-index: 1; }
.hero-copy h1 { font-size: 34px; letter-spacing: -1px; line-height: 1.45; }
.hero-copy p { color: #6f83a5; font-size: 15px; margin-top: 10px; }
.hero-art { position: relative; width: 250px; height: 160px; flex: none; }
.hero-art .cloud { position: absolute; border-radius: 50%; background: #ffffff8f; }
.hero-art .cloud.c1 { width: 130px; height: 48px; left: 0; bottom: 20px; }
.hero-art .cloud.c2 { width: 90px; height: 40px; right: 8px; top: 20px; }
.hero-art .robot { position: absolute; right: 22px; bottom: 8px; width: 105px; height: 120px; border-radius: 34px; background: linear-gradient(#fff, #eaf3ff); border: 8px solid #cfe1ff; box-shadow: 0 16px 30px #7ea7f526; }
.hero-art .robot::before { content: ""; position: absolute; left: 19px; right: 19px; top: 31px; height: 42px; border-radius: 20px; background: #2f7cff; }
.hero-art .robot::after { content: "◡  ◡"; position: absolute; left: 0; right: 0; top: 38px; text-align: center; color: #fff; letter-spacing: 5px; font-size: 14px; }
.hero-art .robot img { position: absolute; left: 50%; bottom: 7px; width: 40px; height: 40px; transform: translateX(-50%); }
.hero-note { position: absolute; right: 158px; top: 32px; color: #4b8bf0; font-size: 15px; line-height: 1.7; font-style: italic; transform: rotate(-10deg); }
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 20px; }
.feature-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; min-height: 190px; display: flex; flex-direction: column; box-shadow: 0 8px 26px rgba(45, 91, 168, .05); }
.feature-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.feature-title { display: flex; align-items: center; gap: 16px; }
.feature-icon { width: 62px; height: 62px; border-radius: 16px; display: grid; place-items: center; color: #fff; flex: none; }
.feature-icon svg { width: 32px; height: 32px; }
.feature-icon.wechat { background: linear-gradient(135deg, #42c86f, #20a958); }
.feature-icon.android { background: linear-gradient(135deg, #6ca2ff, #2f7cff); }
.feature-icon.openclaw { background: linear-gradient(135deg, #6f5bf0, #4a3fd6); }
.feature-icon.tasks { background: linear-gradient(135deg, #8e9dff, #6b72e8); }
.feature-card h3 { font-size: 22px; margin-top: 3px; }
.feature-card p { color: var(--muted); font-size: 14px; line-height: 1.8; margin-top: 18px; }
.feature-sub { font-size: 12px !important; color: #96a3bb !important; }
.feature-meta { margin-top: 8px; color: var(--muted); font-size: 12px; }
.actions { margin-top: auto; padding-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.actions .btn { font-size: 13px; padding: 9px 14px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 6px 11px; font-size: 12px; font-weight: 650; background: #e9f9f0; color: #10a45b; }
.status-pill.gray { background: #f1f4f9; color: #8d99ae; }
.status-pill.blue { background: #eaf2ff; color: #2879ed; }

/* --------------------------------------------------------------- 通用 */

.btn { border: 0; border-radius: 10px; padding: 11px 17px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.secondary { background: #fff; border: 1px solid var(--line); color: #4c5c78; }
.btn.secondary:hover { background: #f4f8ff; }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.danger { background: #fdeeee; color: var(--red); }
.btn.wide { width: 100%; justify-content: space-between; }
.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 5px 10px; font-size: 12px; background: #eef2f8; color: #8490a8; white-space: nowrap; }
.chip.ok { background: #e9f9f0; color: #10a45b; }
.chip.blue { background: #eaf2ff; color: #2879ed; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-heading h1 { font-size: 28px; letter-spacing: -.6px; }
.page-heading p { color: var(--muted); margin-top: 6px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: 0 8px 26px rgba(45, 91, 168, .04); }
.panel h2, .panel h3 { font-size: 18px; }
.panel p { color: var(--muted); margin-top: 7px; }
.panel + .panel { margin-top: 18px; }
.two-column { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; }
.info-list { display: grid; grid-template-columns: 110px 1fr; gap: 12px; margin-top: 18px; font-size: 13px; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; overflow-wrap: anywhere; }
.notice { background: #f2f7ff; border: 1px solid #e0ebff; color: #6680aa; border-radius: 12px; padding: 13px 15px; font-size: 13px; line-height: 1.8; }

/* ------------------------------------------------- 相框 App 下载二维码 */

.app-download { display: flex; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.app-download-qr { width: 196px; height: 196px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.app-download-qr img { width: 100%; height: 100%; object-fit: contain; }
.app-download-info { flex: 1; min-width: 240px; }
.app-download-name { display: block; font-size: 16px; font-weight: 700; }
.app-download-info .info-list { grid-template-columns: 84px 1fr; gap: 9px 12px; margin-top: 12px; }
.app-download-info .actions { margin-top: 16px; }
.app-download-steps { max-width: 640px; font-size: 13px; color: var(--muted); }

/* --------------------------------------------------------------- 列表 */

.device-list, .record-list, .task-list { display: grid; gap: 10px; margin-top: 16px; }
.device-row, .record-row, .task-row { border: 1px solid var(--line); border-radius: 13px; padding: 14px 15px; background: #fff; }
.device-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.device-row-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.device-dot { width: 9px; height: 9px; border-radius: 50%; background: #b8c2d3; flex: none; }
.device-dot.online { background: var(--green); box-shadow: 0 0 0 4px #e6f8ef; }
.device-name { font-weight: 700; }
.device-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.device-row-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.record-head, .task-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.record-head time, .task-head time { color: #9aa6bc; font-size: 11px; }
.record-q, .task-title { font-weight: 650; }
.record-a, .task-summary { color: var(--muted); font-size: 13px; margin-top: 5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty { border: 1px dashed #dbe4f2; border-radius: 13px; padding: 28px; text-align: center; color: var(--muted); margin-top: 16px; }
.address-list { display:grid; gap:14px; }
.address-card { display:flex; justify-content:space-between; gap:18px; align-items:center; padding:20px; background:#fff; border:1px solid #e8eef7; border-radius:16px; }
.address-card h3 { margin:0 0 8px; }
.address-card p { margin:4px 0; color:var(--muted); }
.address-form { display:grid; gap:14px; }
.address-form label { display:grid; gap:7px; font-weight:600; }
.address-form input,.address-form textarea { width:100%; box-sizing:border-box; border:1px solid #d9e2ef; border-radius:10px; padding:11px 12px; font:inherit; }
.address-form textarea { min-height:76px; resize:vertical; }
.address-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.address-grid.three { grid-template-columns:repeat(3,1fr); }
.address-form .check-row { display:flex; grid-template-columns:auto 1fr; align-items:center; font-weight:500; }
.address-form .check-row input { width:auto; }
@media (max-width:720px) { .address-card { align-items:flex-start; flex-direction:column; } .address-grid,.address-grid.three { grid-template-columns:1fr; } }

/* --------------------------------------------------------------- 弹窗 */

.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(28, 50, 84, .42); backdrop-filter: blur(2px); }
.modal-panel { position: relative; width: min(560px, 100%); max-height: 86vh; overflow: auto; background: #fff; border-radius: 18px; padding: 23px; box-shadow: 0 24px 80px rgba(28, 60, 110, .24); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { font-size: 19px; }
.modal-close { border: 0; background: #f0f4fb; color: #7f8ca5; width: 32px; height: 32px; border-radius: 9px; font-size: 21px; line-height: 1; }
.modal-note { color: var(--muted); font-size: 13px; line-height: 1.8; margin-bottom: 14px; }
.qr-wrap { position: relative; width: 220px; height: 220px; margin: 0 auto 14px; border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: #fff; }
.qr-wrap img { width: 100%; height: 100%; object-fit: contain; }
.qr-overlay { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 13px; background: rgba(255,255,255,.94); border-radius: 14px; padding: 20px; }
.bind-code-box { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 auto 14px; padding: 11px 14px; border: 1px dashed #c9dbff; border-radius: 12px; background: #f4f8ff; color: var(--muted); font-size: 13px; }
.bind-code-box strong { color: var(--brand-dark); font-size: 20px; letter-spacing: 2px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.bind-code-box .btn { padding: 6px 10px; font-size: 12px; }
.modal-status { display: flex; justify-content: center; margin-bottom: 14px; }
.center { justify-content: center; }
.detail-list { display: grid; grid-template-columns: 96px 1fr; gap: 10px 12px; margin: 16px 0 0; font-size: 13px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.advanced { margin-top: 16px; font-size: 13px; }
.advanced summary { cursor: pointer; color: var(--muted); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.steps { margin: 10px 0 0; padding-left: 20px; line-height: 2; }
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); padding: 12px 22px; border-radius: 11px; background: #2569d8; color: #fff; font-size: 13px; box-shadow: 0 6px 24px rgba(34, 61, 110, .22); max-width: 90vw; z-index: 100; }
.toast.error { background: var(--red); }
.toast.ok { background: #15995f; }

/* --------------------------------------------------------------- 响应式 */

@media (max-width: 1080px) {
  .user-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .hero-art { display: none; }
  .two-column { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .auth { grid-template-columns: 1fr; }
  .auth-story { padding: 26px 26px 0; background: var(--bg); }
  .story-main, .auth-story > small { display: none; }
  .auth-form-wrap { align-items: stretch; padding: 28px 18px 42px; }
  .auth-form, .qr-register { max-width: none; }
  .user-shell { grid-template-columns: 1fr; }
  .user-sidebar { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .user-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-nav-group { grid-column: 1 / -1; }
  .user-sidebar-foot { display: none; }
  .user-topbar { height: auto; padding: 14px 16px; flex-wrap: wrap; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .user-search { width: 100%; order: 3; }
  .user-main { padding: 18px 16px 30px; }
  .hero-banner { padding: 24px 20px; }
  .hero-copy h1 { font-size: 26px; }
  .home-grid { grid-template-columns: 1fr; }
  .device-row { flex-direction: column; align-items: flex-start; }
  .device-row-actions { width: 100%; justify-content: space-between; }
}

/* ---------------- 对话记录：与后台「会话记录」同一套表格设计 ---------------- */
.history-panel { padding: 0; overflow: hidden; }
.record-filters {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) 132px 150px 120px;
  gap: 9px;
  padding: 14px 16px;
}
.record-filters input,
.record-filters select {
  padding: 9px 11px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}
.records-table-wrap { flex: 1; min-height: 0; overflow: auto; border-top: 1px solid var(--line); }
.records-table { border-collapse: collapse; width: 100%; table-layout: fixed; }
.records-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7f9fd;
  color: #7886a2;
  text-align: left;
  padding: 10px;
  font-size: 11px;
  font-weight: 500;
}
.records-table th:nth-child(1) { width: 112px; }
.records-table th:nth-child(2) { width: 132px; }
.records-table th:nth-child(5) { width: 152px; }
.records-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: #66738f;
  vertical-align: middle;
}
.records-table tr[data-record] { cursor: pointer; }
.records-table tr[data-record]:hover { background: #f7faff; }
.records-table td strong {
  display: block;
  color: #394661;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.records-table td time { color: #9aa6bc; font-size: 11px; }
.answer-summary { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.records-foot {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  color: #929db2;
  font-size: 11px;
}
.record-detail .detail-list { margin-top: 12px; }
.trace-timeline{list-style:none;margin:10px 0 0;padding:0;display:grid;gap:9px}.trace-step{border-left:3px solid #65a4f6;background:#f7faff;border-radius:7px;padding:9px 11px}.trace-step.failed{border-left-color:#df5c5c;background:#fff7f7}.trace-step-head{display:flex;justify-content:space-between;gap:12px;color:#33415f}.trace-step-head span{font-size:10px;color:#8995aa}.trace-step pre{margin:7px 0 0;padding:8px;max-height:240px;overflow:auto;border-radius:5px;background:#eef3fa;font:10px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre-wrap;overflow-wrap:anywhere}.trace-error{margin-top:7px;color:#b83232;font-size:11px}

@media (max-width: 820px) {
  .record-filters { grid-template-columns: 1fr 1fr; }
  .records-table { table-layout: auto; }
}

/* ---------------- 对话记录：模拟对话与历史记录并排 ---------------- */
/* 与后台「会话记录」同一套版式：两栏固定高度、各自内部滚动。
   历史记录再多也不会把模拟对话的输入框顶到页面最下面。 */
.records-layout {
  display: grid;
  grid-template-columns: minmax(330px, 31%) minmax(0, 69%);
  gap: 16px;
  align-items: stretch;
  height: calc(100vh - 232px);
  min-height: 560px;
}
.simulation-panel,
.history-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 10px;
}
.panel-head h2 { font-size: 18px; }
.panel-head p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.simulation-notice {
  margin: 0 16px 12px;
  padding: 9px 11px;
  border: 1px solid #dce9ff;
  background: #f2f7ff;
  color: #5c78a8;
  border-radius: 9px;
  font-size: 11px;
}
.channel-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  padding: 0 16px 12px;
}
.channel-switch button {
  border: 1px solid var(--line);
  background: #f8faff;
  color: #60708c;
  border-radius: 9px;
  padding: 9px 6px;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.channel-switch button svg { width: 16px; height: 16px; flex: none; }
.channel-switch button.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}
.simulation-chat {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 16px;
  background: linear-gradient(180deg, #fff, #fbfdff);
}
.sim-empty {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  color: #99a7bf;
  text-align: center;
}
.sim-empty svg { width: 34px; height: 34px; color: #7fb0f7; }
.sim-empty strong { color: #52617e; font-size: 13px; }
.sim-empty span { font-size: 11px; max-width: 240px; line-height: 1.7; }
.sim-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 12px 0;
}
.sim-line.user { justify-content: flex-end; }
.sim-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e8f1ff;
  color: var(--brand);
  font-size: 11px;
  flex: none;
}
.sim-avatar.user { background: #e9f8f0; color: #12a45d; }
.sim-line > div { max-width: 82%; }
.sim-bubble {
  padding: 9px 12px;
  border-radius: 4px 12px 12px 12px;
  background: #f0f4fa;
  color: #34425c;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.sim-line.user .sim-bubble {
  background: var(--brand);
  color: #fff;
  border-radius: 12px 4px 12px 12px;
}
.sim-line time {
  display: block;
  color: #a0abc3;
  font-size: 10px;
  margin-top: 4px;
}
.simulation-compose {
  border-top: 1px solid var(--line);
  padding: 12px 14px;
}
.simulation-compose textarea {
  width: 100%;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 13px;
  min-height: 58px;
}
.sim-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.sim-actions .btn { font-size: 12px; padding: 8px 11px; }
.simulation-compose small {
  display: block;
  color: #9aa6bc;
  font-size: 10px;
  margin-top: 7px;
}

@media (max-width: 1080px) {
  .records-layout { grid-template-columns: 1fr; }
  /* 窄屏上下排布：两块面板各自限高并内部滚动，输入框始终留在模拟对话面板里。 */
  .records-layout { height: auto; min-height: 0; }
  .simulation-panel { min-height: 480px; max-height: 78vh; }
  .history-panel { min-height: 420px; max-height: 78vh; }
}

/* ---------------- 谐音词：ASR 纠错词库（用户端只管理自己的词条） ---------------- */
.page-heading-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.homo-list { margin-top: 14px; display: grid; gap: 10px; }
.homo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 14px 16px;
  background: #fff;
}
.homo-row-main { min-width: 0; display: grid; gap: 8px; }
.homo-row-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.homo-row-title strong { font-size: 15px; }
.homo-row-variants { color: var(--muted); font-size: 12px; line-height: 1.9; }
.homo-variant {
  display: inline-flex;
  align-items: center;
  background: #f1f5fc;
  color: #5c6b86;
  border-radius: 999px;
  padding: 3px 9px;
  margin: 0 6px 0 0;
  font-size: 12px;
}
.homo-row-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.homo-form { display: grid; gap: 16px; }
.homo-form label { display: grid; gap: 7px; font-size: 13px; color: var(--muted); }
.homo-form input[type="text"],
.homo-form input:not([type]),
.homo-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  background: #fff;
  color: var(--ink);
}
.homo-field > span { display: block; font-size: 13px; color: var(--muted); }
.homo-field > p { font-size: 12px; margin: 5px 0 9px; }
.homo-variant-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.homo-variant-row input { flex: 1; }
.homo-variant-row .btn { padding: 8px 12px; font-size: 15px; color: #8d99ae; }
#homo-variant-quota { display: block; margin-top: 6px; font-size: 12px; }
.homo-switch { display: flex !important; align-items: center; gap: 8px; }
.homo-switch input { width: auto; }
.homo-test-row { display: flex; gap: 10px; margin-top: 14px; }
.homo-test-row input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  color: var(--ink);
}
.homo-test-result {
  margin-top: 14px;
  border: 1px solid #e0ebff;
  background: #f7faff;
  border-radius: 13px;
  padding: 14px 16px;
  display: grid;
  gap: 10px;
}
.homo-test-line { font-size: 13px; }
.homo-test-line > span { display: block; color: #8d99ae; font-size: 11px; margin-bottom: 4px; }
.homo-test-line > p { color: var(--ink); line-height: 1.8; word-break: break-word; }
.homo-mark { background: #dcebff; color: var(--brand-dark); border-radius: 5px; padding: 1px 4px; }
.homo-hits { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.homo-hit {
  background: #e9f9f0;
  color: #10a45b;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}

@media (max-width: 720px) {
  .homo-row { flex-direction: column; align-items: flex-start; }
  .homo-row-actions { width: 100%; justify-content: space-between; }
  .homo-test-row { flex-direction: column; }
}
