/* ============================================================
   AI 问答 · Claude-Chat 式布局（我们的象牙/酒红/古金色调）
   载入顺序在 site.css 之后，覆盖旧的 .ask-* 布局；消息子样式
   （.ask-thinking / .ask-sources / .ask-schools / .ask-cta-row）
   继续沿用 site.css。
   ============================================================ */

[data-brand="juris-ivy"] .ask-app-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* 本页隐藏全局浮动"预约咨询"（与侧栏 CTA 重复且压住输入框） */
[data-brand="juris-ivy"] .book-fab { display: none !important; }

[data-brand="juris-ivy"] .ask-app {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  width: min(1360px, 100%);
  margin: 0 auto;
  height: clamp(560px, calc(100dvh - 7.5rem), 900px);
  border: 1px solid var(--line);
  border-top: 2px solid var(--oxblood);
  background: var(--paper);
  box-shadow: 0 26px 60px rgba(27, 23, 20, 0.1);
  overflow: hidden;
}

/* ---------- 左侧栏 ---------- */
[data-brand="juris-ivy"] .ask-side {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 0;
  padding: 1.1rem 0.85rem 0.9rem;
  background: linear-gradient(180deg, #f3ecdd 0%, #eee4d0 100%);
  border-right: 1px solid var(--line);
}

[data-brand="juris-ivy"] .ask-side-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.1rem 0.35rem 0.6rem;
}

[data-brand="juris-ivy"] .ask-side-seal {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--brass);
  background: radial-gradient(circle at 50% 40%, rgba(168, 136, 78, 0.18), rgba(110, 29, 36, 0.06));
}
[data-brand="juris-ivy"] .ask-side-seal img { height: 0.85rem; width: auto; opacity: 0.92; }

[data-brand="juris-ivy"] .ask-side-title {
  font-family: var(--ji-display);
  font-size: 1.02rem;
  color: var(--oxblood);
  letter-spacing: 0.01em;
}

[data-brand="juris-ivy"] .ask-side-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  border: 1px solid var(--brass);
  border-radius: 11px;
  background: rgba(168, 136, 78, 0.1);
  color: var(--oxblood);
  padding: 0.62rem 0.8rem;
  font: 600 0.9rem var(--ji-body);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
[data-brand="juris-ivy"] .ask-side-new:hover { background: rgba(168, 136, 78, 0.18); transform: translateY(-1px); }

[data-brand="juris-ivy"] .ask-side-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-top: 0.4rem;
  padding-right: 0.15rem;
}

[data-brand="juris-ivy"] .ask-side-h {
  margin: 0.9rem 0.35rem 0.35rem;
  color: var(--brass);
  font: 600 0.66rem var(--ji-body);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
[data-brand="juris-ivy"] .ask-side-scroll .ask-side-h:first-child { margin-top: 0.2rem; }

[data-brand="juris-ivy"] .ask-side-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  padding: 0.5rem 0.55rem;
  font: 500 0.855rem/1.4 var(--ji-body);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
[data-brand="juris-ivy"] .ask-side-item:hover { background: rgba(110, 29, 36, 0.07); color: var(--oxblood); }
[data-brand="juris-ivy"] .ask-side-item::before {
  content: "";
  flex: 0 0 auto;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--brass); opacity: 0.55;
}
[data-brand="juris-ivy"] .ask-side-link::before { display: none; }
[data-brand="juris-ivy"] .ask-side-link { color: var(--stone); font-weight: 600; }
[data-brand="juris-ivy"] .ask-side-link::after { content: "→"; margin-left: auto; color: var(--brass); }

/* 最近对话行 */
[data-brand="juris-ivy"] .ask-convo {
  display: flex;
  align-items: center;
  border-radius: 9px;
  transition: background 0.14s ease;
}
[data-brand="juris-ivy"] .ask-convo:hover { background: rgba(110, 29, 36, 0.06); }
[data-brand="juris-ivy"] .ask-convo.is-active { background: rgba(110, 29, 36, 0.1); }
[data-brand="juris-ivy"] .ask-convo-open {
  flex: 1;
  min-width: 0;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0.5rem 0.15rem 0.5rem 0.55rem;
  font: 500 0.855rem/1.4 var(--ji-body);
  cursor: pointer;
}
[data-brand="juris-ivy"] .ask-convo-open span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
[data-brand="juris-ivy"] .ask-convo.is-active .ask-convo-open { color: var(--oxblood); font-weight: 600; }
[data-brand="juris-ivy"] .ask-convo-del {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--stone);
  font-size: 1.05rem;
  line-height: 1;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.14s ease, color 0.14s ease;
}
[data-brand="juris-ivy"] .ask-convo:hover .ask-convo-del,
[data-brand="juris-ivy"] .ask-convo.is-active .ask-convo-del { opacity: 1; }
[data-brand="juris-ivy"] .ask-convo-del:hover { color: var(--oxblood); }

[data-brand="juris-ivy"] .ask-side-foot {
  border-top: 1px solid rgba(168, 136, 78, 0.28);
  padding-top: 0.8rem;
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
[data-brand="juris-ivy"] .ask-side-meter {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 0.35rem;
  color: var(--stone); font-size: 0.8rem;
}
[data-brand="juris-ivy"] .ask-side-meter strong { color: var(--oxblood); font-family: var(--ji-display); font-size: 1.35rem; line-height: 1; }
[data-brand="juris-ivy"] .ask-side-cta {
  display: block; text-align: center; text-decoration: none;
  border-radius: 10px; background: var(--oxblood); color: #fdf6ee;
  padding: 0.6rem 0.8rem; font: 600 0.86rem var(--ji-body);
  transition: background 0.15s ease;
}
[data-brand="juris-ivy"] .ask-side-cta:hover { background: #571119; }

/* ---------- 主列 ---------- */
[data-brand="juris-ivy"] .ask-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(168, 136, 78, 0.05), transparent 60%),
    var(--paper);
}

[data-brand="juris-ivy"] .ask-colbar {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.9rem clamp(1rem, 5vw, 3rem);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
[data-brand="juris-ivy"] .ask-colbar h1 {
  margin: 0; font-family: var(--ji-display); font-weight: 500;
  font-size: 1.1rem; color: var(--ink);
}
[data-brand="juris-ivy"] .ask-colbar-sub { color: var(--stone); font-size: 0.8rem; }

/* 对话流：居中阅读列，助手平铺、用户右侧气泡 */
[data-brand="juris-ivy"] .ask-thread {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
  overflow-y: auto;
  padding: 1.6rem clamp(1rem, 6vw, 3.5rem);
  scroll-behavior: smooth;
}
[data-brand="juris-ivy"] .ask-thread.is-chatting { justify-content: flex-start; }
[data-brand="juris-ivy"] .ask-thread.is-chatting .ask-welcome { display: none; }

[data-brand="juris-ivy"] .ask-bubble {
  width: min(46rem, 100%);
  margin: 0 auto;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink);
  line-height: 1.78;
}
/* 用户：右侧酒红气泡 */
[data-brand="juris-ivy"] .ask-bubble-user {
  width: fit-content;
  max-width: min(34rem, 82%);
  margin: 0 0 0 auto;
  border-radius: 14px 14px 4px 14px;
  background: var(--oxblood);
  color: #fdf6ee;
  padding: 0.7rem 1rem;
}
/* 助手：平铺全宽、无框 */
[data-brand="juris-ivy"] .ask-bubble-assistant {
  width: min(46rem, 100%);
  margin: 0 auto;
}

/* ---------- 空态欢迎区（居中） ---------- */
[data-brand="juris-ivy"] .ask-welcome {
  width: min(34rem, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.8rem;
}
[data-brand="juris-ivy"] .ask-welcome-seal {
  display: grid; place-items: center;
  width: 3.6rem; height: 3.6rem; border-radius: 50%;
  border: 1px solid var(--brass);
  background: radial-gradient(circle at 50% 38%, rgba(168, 136, 78, 0.16), rgba(110, 29, 36, 0.05));
  box-shadow: 0 0 0 6px rgba(168, 136, 78, 0.07);
}
[data-brand="juris-ivy"] .ask-welcome-seal img { height: 1.55rem; width: auto; opacity: 0.92; }
[data-brand="juris-ivy"] .ask-welcome-lead {
  margin: 0.2rem 0 0; color: var(--oxblood); font-family: var(--ji-display);
  font-weight: 500; font-size: clamp(1.35rem, 2.4vw, 1.8rem); line-height: 1.22;
}
[data-brand="juris-ivy"] .ask-welcome-sub {
  margin: 0; max-width: 27rem; color: var(--stone); font-size: 0.95rem; line-height: 1.72;
}
[data-brand="juris-ivy"] .ask-welcome-chips {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 0.7rem;
}
[data-brand="juris-ivy"] .ask-chip {
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(168, 136, 78, 0.06); color: var(--ink);
  padding: 0.45rem 0.9rem; font: 500 0.85rem var(--ji-body); cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
[data-brand="juris-ivy"] .ask-chip:hover { border-color: var(--oxblood); color: var(--oxblood); background: rgba(110, 29, 36, 0.05); }

/* ---------- 底部输入区（大圆角） ---------- */
[data-brand="juris-ivy"] .ask-composer {
  flex: 0 0 auto;
  padding: 0.75rem clamp(1rem, 6vw, 3.5rem) 1rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(251, 246, 236, 0), #fbf6ec 40%);
}
[data-brand="juris-ivy"] .ask-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.5rem;
  width: min(46rem, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf9;
  padding: 0.45rem 0.5rem 0.45rem 1rem;
  box-shadow: 0 6px 20px rgba(27, 23, 20, 0.06);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
[data-brand="juris-ivy"] .ask-form:focus-within {
  border-color: var(--brass);
  box-shadow: 0 6px 22px rgba(110, 29, 36, 0.1);
}
[data-brand="juris-ivy"] .ask-form textarea {
  border: 0; background: transparent; resize: none;
  min-height: 2.6rem; max-height: 9rem;
  padding: 0.55rem 0; color: var(--ink);
  font: 1rem/1.5 var(--ji-body);
}
[data-brand="juris-ivy"] .ask-form textarea:focus { outline: none; }
[data-brand="juris-ivy"] .ask-send {
  align-self: end;
  display: grid; place-items: center;
  width: 2.6rem; height: 2.6rem; border: 0; border-radius: 50%;
  background: var(--oxblood); color: #fdf6ee;
  font-size: 1.15rem; line-height: 1; cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}
[data-brand="juris-ivy"] .ask-send:hover { background: #571119; }
[data-brand="juris-ivy"] .ask-send:disabled { background: var(--stone); opacity: 0.5; cursor: default; }
[data-brand="juris-ivy"] .ask-send:active { transform: scale(0.94); }

[data-brand="juris-ivy"] .ask-status {
  width: min(46rem, 100%);
  margin: 0.45rem auto 0;
  min-height: 1.1rem;
  color: var(--stone);
  font-size: 0.82rem;
}
[data-brand="juris-ivy"] .ask-composer-hint {
  width: min(46rem, 100%);
  margin: 0.25rem auto 0;
  text-align: center;
  color: var(--stone);
  font-size: 0.72rem;
  opacity: 0.8;
}

/* ---------- 响应式：窄屏隐藏侧栏 ---------- */
@media (max-width: 860px) {
  [data-brand="juris-ivy"] .ask-app {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }
  [data-brand="juris-ivy"] .ask-side { display: none; }
  [data-brand="juris-ivy"] .ask-thread {
    justify-content: flex-start;
    min-height: 62vh;
    padding: 1.4rem 1rem;
  }
  [data-brand="juris-ivy"] .ask-composer { padding: 0.7rem 1rem 1rem; }
}
