/* HSH 演示平台样式 */
.demo-page { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

/* 顶栏 */
.dtop {
  height: 60px; flex-shrink: 0;
  display: flex; align-items: center; gap: 16px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 12, 15, 0.9);
  backdrop-filter: blur(14px);
  position: relative; z-index: 20;
}

.dtop .logo { font-size: 15.5px; }
.dtop .logo__mark { width: 27px; height: 27px; font-size: 12px; border-radius: 8px; }

.dtop__tag {
  font-size: 12px; padding: 3px 10px; border-radius: 100px;
  background: rgba(74, 222, 192, 0.1); color: var(--cyan);
  border: 1px solid rgba(74, 222, 192, 0.22);
}

.dtop__back {
  margin-left: auto; font-size: 13.5px; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 9px; border: 1px solid var(--line);
  transition: color .18s, border-color .18s, background .18s;
}
.dtop__back:hover { color: var(--text); border-color: var(--line-strong); background: rgba(255,255,255,.04); }

.side-toggle {
  display: none; width: 36px; height: 36px; border-radius: 9px;
  border: 1px solid var(--line); background: rgba(255,255,255,.03);
  color: var(--text); align-items: center; justify-content: center;
}

/* 主体布局 */
.dshell { flex: 1; display: flex; min-height: 0; }

/* 侧栏 */
.dside {
  width: 290px; flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: var(--bg-soft);
  display: flex; flex-direction: column;
  overflow-y: auto;
}

.dside__head { padding: 20px 18px 14px; border-bottom: 1px solid var(--line); }
.dside__head h2 { font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin: 0 0 12px; }

.dside__hint {
  font-size: 12.5px; color: var(--text-3); line-height: 1.6; margin: 0;
}

.agent-list { padding: 10px; display: grid; gap: 4px; }

.agent-item {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 12px; border-radius: 11px;
  background: transparent; border: 1px solid transparent;
  text-align: left; color: var(--text);
  transition: background .18s, border-color .18s;
  width: 100%;
}

.agent-item:hover { background: rgba(255, 255, 255, 0.04); }

.agent-item.is-active {
  background: rgba(74, 222, 192, 0.09);
  border-color: rgba(74, 222, 192, 0.26);
}

.agent-item__icon { font-size: 19px; line-height: 1.2; flex-shrink: 0; }
.agent-item__txt { min-width: 0; }
.agent-item__txt b { display: block; font-size: 14px; font-weight: 640; margin-bottom: 2px; letter-spacing: -.01em; }
.agent-item__txt small { display: block; font-size: 11.6px; color: var(--text-3); line-height: 1.4; }

.dside__note {
  margin: auto 14px 16px; padding: 14px;
  border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  font-size: 12.2px; color: var(--text-3); line-height: 1.68;
}
.dside__note b { color: var(--text-2); font-weight: 600; }
.dside__company {
  display: block; margin-top: 12px; padding-top: 11px;
  border-top: 1px solid var(--line); font-size: 11.6px; color: var(--text-3);
}

/* 主区 */
.dmain { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.dhead {
  flex-shrink: 0; padding: 16px 26px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  background: var(--bg);
}

.dhead__icon {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 20px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
}

.dhead__txt h1 { font-size: 16px; font-weight: 660; margin: 0 0 2px; letter-spacing: -.01em; }
.dhead__txt p { font-size: 12.5px; color: var(--text-3); margin: 0; }

/* 对话区 */
.chat {
  flex: 1; overflow-y: auto; padding: 26px;
  display: flex; flex-direction: column; gap: 20px;
  scroll-behavior: smooth;
}

.msg { display: flex; gap: 12px; max-width: 820px; }
.msg--user { flex-direction: row-reverse; margin-left: auto; }

.msg__avatar {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 15px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
}

.msg--user .msg__avatar {
  background: rgba(74, 222, 192, 0.14);
  border-color: rgba(74, 222, 192, 0.3);
  font-size: 12.5px; font-weight: 600; color: var(--cyan);
}

.msg__body {
  padding: 14px 17px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 14.6px; line-height: 1.75; color: var(--text);
  min-width: 0; overflow-wrap: break-word;
}

.msg--user .msg__body {
  background: rgba(74, 222, 192, 0.1);
  border-color: rgba(74, 222, 192, 0.2);
}

.msg__body > p { margin: 0 0 10px; }
.msg__body > p:last-child { margin-bottom: 0; }
.msg__body strong { color: var(--text); font-weight: 660; }

.msg__body code {
  font-family: var(--ff-mono); font-size: 12.8px;
  background: rgba(255, 255, 255, 0.07); padding: 1px 6px; border-radius: 5px;
}

.msg__body ul, .msg__body ol { margin: 8px 0 10px; padding-left: 20px; }
.msg__body li { margin-bottom: 5px; }

.msg__body blockquote {
  margin: 12px 0 0; padding: 10px 14px;
  border-left: 2px solid rgba(74, 222, 192, 0.45);
  background: rgba(74, 222, 192, 0.05);
  border-radius: 0 8px 8px 0;
  font-size: 13.4px; color: var(--text-2);
}

.msg__body blockquote p { margin: 0; }

.msg__body table {
  width: 100%; border-collapse: collapse; margin: 10px 0;
  font-size: 13.4px;
}

.msg__body th, .msg__body td {
  padding: 7px 10px; text-align: left;
  border-bottom: 1px solid var(--line);
}

.msg__body th {
  color: var(--text-3); font-weight: 600; font-size: 12.4px;
  text-transform: none; background: rgba(255, 255, 255, 0.025);
}

/* 打字中 */
.msg--typing .msg__body {
  display: flex; align-items: center; gap: 5px;
  padding: 16px 17px;
}

.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-3); display: inline-block;
  animation: bounce 1.3s infinite ease-in-out;
}
.dot:nth-child(2) { animation-delay: .18s; }
.dot:nth-child(3) { animation-delay: .36s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* 建议 chips */
.suggest {
  flex-shrink: 0; padding: 0 26px 10px;
  display: flex; flex-wrap: wrap; gap: 8px;
}

.chip {
  font-size: 13px; padding: 7px 14px; border-radius: 100px;
  background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line);
  color: var(--text-2); transition: all .18s;
  font-family: inherit;
}

.chip:hover {
  background: rgba(74, 222, 192, 0.09);
  border-color: rgba(74, 222, 192, 0.3);
  color: var(--cyan);
}

/* 输入框 */
.composer {
  flex-shrink: 0; padding: 14px 26px 20px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.composer__box {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 8px 8px 8px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color .2s;
}

.composer__box:focus-within { border-color: rgba(74, 222, 192, 0.4); }

.composer__box textarea {
  flex: 1; resize: none; border: none; outline: none; background: transparent;
  color: var(--text); font-family: inherit; font-size: 14.6px; line-height: 1.6;
  padding: 8px 0; max-height: 120px; min-height: 24px;
}

.composer__box textarea::placeholder { color: #4E5560; }

.composer__send {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: var(--grad); color: #05211B; border: none;
  display: grid; place-items: center;
  transition: filter .18s, transform .18s;
}

.composer__send:hover { filter: brightness(1.08); transform: scale(1.03); }
.composer__send:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.composer__hint {
  font-size: 11.8px; color: var(--text-3);
  margin: 10px 0 0; text-align: center;
}

/* 响应式 */
@media (max-width: 900px) {
  .side-toggle { display: flex; }

  .dside {
    position: fixed; top: 60px; bottom: 0; left: 0; z-index: 30;
    width: 280px; transform: translateX(-100%);
    transition: transform .26s cubic-bezier(.16,1,.3,1);
    box-shadow: 24px 0 60px -20px rgba(0,0,0,.7);
  }

  body.side-open .dside { transform: none; }
  body.side-open::after {
    content: ""; position: fixed; inset: 60px 0 0 0; z-index: 25;
    background: rgba(0,0,0,.55); backdrop-filter: blur(2px);
  }

  .chat { padding: 18px 16px; }
  .suggest { padding: 0 16px 8px; }
  .composer { padding: 12px 16px 16px; }
  .dhead { padding: 12px 16px; }
  .dtop { padding: 0 14px; }
  .msg { max-width: 100%; }
  .msg__body { font-size: 14.2px; }
}

@media (max-width: 520px) {
  .dtop__tag { display: none; }
  .dhead__txt p { display: none; }
  .msg__body table { font-size: 12.6px; }
  .msg__body th, .msg__body td { padding: 6px 7px; }
}
