/* ============================================================
   assets/css/assistant.css —— 内网 Web 助手（/assistant.html）
   ------------------------------------------------------------
   三栏一屏：会话列表 / 对话区 / 详情区（方案 §6.1）。
   样式一律用 style.css 的设计令牌（颜色、圆角、字阶），不写第二种取值 ——
   否则「改配色要改三处」的老问题会在这里重来一遍。

   两条约束来自部署形态：
     · 内网部署没有外网：不引任何外部字体 / CDN，只用系统字体栈。
     · 演示现场是笔记本：1100px 以下把左栏收起，对话区不能被挤成一条缝。
   ============================================================ */

.ast-body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-soft);
  font-family: var(--sans);
  color: var(--text);
}

/* ---------- 演示横幅：固定在最上面，客户看到的每个数字都在它下面 ---------- */
.ast-demo {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 7px 16px;
  background: var(--gold-095b);
  color: var(--gold-035);
  border-bottom: 1px solid var(--gold-085);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.02em;
}

/* ---------- 骨架 ---------- */
.ast {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 288px;
  gap: 0;
  height: calc(100vh - 33px);
  max-height: calc(100vh - 33px);
}

.ast__side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: #fff;
}

.ast__side-top {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
}

.ast__sessions {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
}

.ast__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  font-size: var(--fs-base);
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ast__item:hover { background: var(--bg-soft); }
.ast__item[aria-current="true"] {
  background: var(--gold-095b);
  border-color: var(--gold-085);
  color: var(--gold-035);
  font-weight: 600;
}

.ast__item time {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--muted);
  font-weight: 400;
}

/* ---------- 中栏 ---------- */
.ast__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg-soft);
}

.ast__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.ast__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-md);
}

.ast__brand strong { font-size: var(--fs-xl); letter-spacing: -0.01em; }
.ast__tag {
  font-size: var(--fs-xs);
  color: var(--gold-035);
  background: var(--gold-095b);
  border-radius: var(--radius-pill);
  padding: 3px 9px;
}

.ast__who { font-size: var(--fs-sm); color: var(--muted); }

.ast__flow {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 18px 8px;
}

/* ---------- 消息 ---------- */
.ast__msg { margin-bottom: 16px; max-width: 100%; }

.ast__msg--user {
  display: flex;
  justify-content: flex-end;
}

.ast__bubble {
  display: inline-block;
  max-width: 78%;
  padding: 9px 13px;
  border-radius: var(--radius-md);
  background: var(--navy-soft);
  color: var(--text);
  font-size: var(--fs-md);
  line-height: var(--lh-base);
  white-space: pre-wrap;
  word-break: break-word;
}

.ast__say {
  font-size: var(--fs-md);
  line-height: var(--lh-base);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 10px;
}

.ast__meta {
  margin-top: 6px;
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* ---------- 输入区 ---------- */
.ast__composer {
  padding: 10px 18px 14px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.ast__row {
  display: flex;
  gap: 9px;
  align-items: flex-end;
}

.ast__input {
  flex: 1;
  min-height: 40px;
  max-height: 130px;
  resize: none;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--text);
  background: #fff;
}

.ast__input:focus {
  outline: 2px solid var(--gold-075);
  outline-offset: -1px;
  border-color: var(--gold-075);
}

.ast__foot {
  margin-top: 7px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: var(--fs-xs);
  color: var(--muted);
  flex-wrap: wrap;
}

/* 装到桌面（F 批 · 产品化）：默认收起，收起态只有一句话。
   放输入区下方而不是侧栏 —— 侧栏在窄屏是 display:none，而这件事最需要手机上看见。 */
.ast__install {
  margin-top: 9px;
  font-size: var(--fs-xs);
  line-height: var(--lh-base);
  color: var(--muted);
}

.ast__install summary {
  cursor: pointer;
  list-style: none;
  color: var(--muted);
}

.ast__install summary::-webkit-details-marker { display: none; }

.ast__install summary::before {
  content: "＋";
  margin-right: 5px;
  color: var(--gold-075);
}

.ast__install[open] summary::before { content: "－"; }

.ast__install summary strong { color: var(--text); }

.ast__install ul {
  margin: 6px 0 0;
  padding-left: 17px;
}

.ast__install li strong { color: var(--text); font-weight: 600; }

.ast__starters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.ast__chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius-pill);
  padding: 5px 11px;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--text);
  cursor: pointer;
}

.ast__chip:hover { border-color: var(--gold-075); color: var(--gold-035); }

/* ---------- 登录门 ---------- */
.ast-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg-soft);
}

.ast-gate__card {
  width: 100%;
  max-width: 356px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  box-shadow: var(--shadow);
}

.ast-gate__card h1 {
  margin: 0 0 6px;
  font-size: var(--fs-2xl);
  color: var(--navy);
}

.ast-gate__card p {
  margin: 0 0 18px;
  font-size: var(--fs-base);
  color: var(--muted);
  line-height: 1.7;
}

.ast-gate__card .field { margin-bottom: 12px; }

/* ---------- 窄屏：左栏收起，右栏垫到下方 ---------- */
@media (max-width: 1180px) {
  .ast { grid-template-columns: 200px minmax(0, 1fr) 0; }
  .ast__detail { display: none; }
}

@media (max-width: 860px) {
  .ast { grid-template-columns: 0 minmax(0, 1fr) 0; height: calc(100vh - 33px); }
  .ast__side { display: none; }
  .ast__bubble { max-width: 90%; }
}

/* 减少动态：本页没有关键动画，只关掉过渡，避免「开了减少动态还在动」 */
@media (prefers-reduced-motion: reduce) {
  .ast * { transition: none !important; animation: none !important; }
}
