.assistant-launcher {
  position: fixed;
  z-index: 120;
  right: 22px;
  bottom: 22px;
  min-width: 142px;
  min-height: 54px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(212, 184, 134, 0.5);
  border-radius: 999px;
  color: #1b2340;
  background: #d4b886;
  box-shadow: 0 18px 48px rgba(27, 35, 64, 0.22);
  font-weight: 800;
  cursor: pointer;
}

.assistant-launcher span {
  font-size: 18px;
}

.assistant-overlay {
  position: fixed;
  z-index: 130;
  inset: 0;
  display: grid;
  justify-items: end;
  align-items: stretch;
  min-height: 0;
  background: rgba(10, 16, 33, 0.56);
  backdrop-filter: blur(8px);
}

.assistant-overlay[hidden] {
  display: none;
}

.assistant-panel {
  width: min(520px, 100vw);
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  color: #1d2945;
  background: #f7f3ec;
  box-shadow: -24px 0 80px rgba(10, 16, 33, 0.24);
}

.assistant-panel--page {
  width: 100%;
  min-height: min(680px, calc(100dvh - 150px));
  height: min(820px, calc(100vh - 150px));
  max-height: calc(100dvh - 120px);
  border: 1px solid rgba(27, 35, 64, 0.13);
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(27, 35, 64, 0.13);
}

.assistant-head {
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #f7f3ec;
  background: #1b2340;
  border-bottom: 1px solid rgba(247, 243, 236, 0.1);
}

.assistant-head__mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #1b2340;
  background: #d4b886;
  font-size: 19px;
}

.assistant-head__text {
  min-width: 0;
  flex: 1;
}

.assistant-head__text > strong,
.assistant-head__text > span {
  display: block;
}

.assistant-head__text > span {
  color: rgba(247, 243, 236, 0.66);
  font-size: 12px;
}

.assistant-head__actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.assistant-close,
.assistant-reset {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(247, 243, 236, 0.18);
  border-radius: 50%;
  color: #f7f3ec;
  background: transparent;
  cursor: pointer;
}

.assistant-reset {
  font-size: 18px;
}

.assistant-tasks {
  padding: 14px 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(27, 35, 64, 0.1);
  scrollbar-width: thin;
}

.assistant-tasks button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid rgba(27, 35, 64, 0.13);
  border-radius: 999px;
  color: #4f586b;
  background: #fffdf9;
  cursor: pointer;
}

.assistant-tasks button:hover,
.assistant-tasks button:focus-visible {
  color: #f7f3ec;
  background: #253153;
}

.assistant-log {
  margin: 0;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  min-height: 0;
  list-style: none;
}

.assistant-message {
  max-width: 88%;
  padding: 15px 17px;
  border-radius: 18px 18px 18px 5px;
  background: #fffdf9;
  box-shadow: 0 8px 26px rgba(27, 35, 64, 0.07);
}

.assistant-message--user {
  align-self: flex-end;
  border-radius: 18px 18px 5px 18px;
  color: #f7f3ec;
  background: #253153;
}

.assistant-message--urgent {
  max-width: 96%;
  border: 2px solid #9a4b3f;
  background: #fff5ef;
  box-shadow: 0 12px 32px rgba(113, 45, 34, 0.13);
}

.assistant-message p {
  margin: 0;
}

.assistant-message p + p {
  margin-top: 9px;
}

.assistant-message__label {
  margin-bottom: 6px !important;
  color: #80602b;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.assistant-message--user .assistant-message__label {
  color: #d4b886;
}

.assistant-answer__title {
  margin: 0 0 9px;
  color: #1b2340;
  font-size: 17px;
  line-height: 1.4;
}

.assistant-materials {
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(27, 35, 64, 0.1);
  border-radius: 13px;
  background: #f7f3ec;
}

.assistant-materials strong {
  display: block;
  margin-bottom: 6px;
  color: #80602b;
  font-size: 12px;
}

.assistant-materials ul {
  margin: 0;
  padding-left: 18px;
  color: #4f586b;
  font-size: 13px;
}

.assistant-materials li + li {
  margin-top: 4px;
}

.assistant-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.assistant-actions a,
.assistant-actions button {
  min-height: 44px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(27, 35, 64, 0.15);
  border-radius: 999px;
  color: #1b2340;
  background: #f7f3ec;
  font-size: 13px;
  font-weight: 700;
}

.assistant-actions--utility {
  margin-top: 8px;
}

.assistant-actions--utility button {
  color: #4f586b;
  border-color: rgba(27, 35, 64, 0.16);
  background: #f7f3ec;
}

.assistant-sources {
  margin-top: 11px;
  color: #4f586b;
  font-size: 12px;
}

.assistant-sources summary {
  width: max-content;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  color: #6b579f;
  cursor: pointer;
}

.assistant-sources div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 5px;
}

.assistant-sources a {
  min-height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: #1b2340;
  background: #eee6da;
  font-weight: 700;
}

.assistant-related {
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid rgba(27, 35, 64, 0.1);
}

.assistant-related > span {
  display: block;
  margin-bottom: 7px;
  color: #61697a;
  font-size: 12px;
}

.assistant-related button {
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 8px 11px;
  border: 1px solid rgba(27, 35, 64, 0.12);
  border-radius: 12px;
  color: #1b2340;
  background: #fffdf9;
  text-align: left;
  cursor: pointer;
}

.assistant-related button:hover,
.assistant-related button:focus-visible {
  border-color: #80602b;
  background: #f7f3ec;
}

.assistant-note {
  margin-top: 10px !important;
  color: #61697a;
  font-size: 12px;
}

.assistant-composer {
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(27, 35, 64, 0.1);
  background: #fffdf9;
}

.assistant-composer__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.assistant-composer textarea {
  min-height: 50px;
  max-height: 126px;
  padding: 12px 14px;
  resize: vertical;
  border: 1px solid rgba(27, 35, 64, 0.16);
  border-radius: 15px;
  color: #1d2945;
  background: #f7f3ec;
}

.assistant-composer button {
  min-width: 76px;
  border: 0;
  border-radius: 15px;
  color: #1b2340;
  background: #d4b886;
  font-weight: 850;
  cursor: pointer;
}

.assistant-composer small {
  display: block;
  margin-top: 8px;
  color: #61697a;
  font-size: 11px;
}

.assistant-panel[aria-busy="true"] .assistant-composer button {
  opacity: 0.64;
  pointer-events: none;
}

body.assistant-open {
  overflow: hidden;
}

body[data-page="ask"] .portal-header {
  position: relative;
}

.assistant-static-fallback {
  min-height: 520px;
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid rgba(27, 35, 64, 0.13);
  border-radius: 30px;
  color: #1b2340;
  background: #fffdf9;
  box-shadow: 0 24px 70px rgba(27, 35, 64, 0.1);
}

.assistant-static-fallback h2 {
  margin: 8px 0 12px;
}

.assistant-static-fallback > div {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.assistant-static-fallback a {
  min-height: 50px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(27, 35, 64, 0.12);
  border-radius: 14px;
  color: #1b2340;
  background: #f7f3ec;
  font-weight: 750;
}

.assistant-static-fallback__urgent {
  margin-top: 22px;
  padding: 14px 15px;
  border-left: 4px solid #9a4b3f;
  border-radius: 0 12px 12px 0;
  color: #6c352d;
  background: #fff5ef;
}

@media (max-width: 980px) {
  body[data-page="ask"] .feature-split {
    display: flex;
    flex-direction: column;
  }

  body[data-page="ask"] [data-assistant-app] {
    order: -1;
  }
}

@media (max-width: 680px) {
  body[data-page="ask"] {
    padding-bottom: 0;
  }

  body[data-page="ask"] .portal-header {
    position: relative;
  }

  body[data-page="ask"] .mobile-dock {
    display: none;
  }

  .assistant-launcher {
    display: none;
  }

  .assistant-panel {
    width: 100%;
  }

  .assistant-panel--page {
    height: calc(100dvh - 68px);
    max-height: calc(100dvh - 68px);
    min-height: 0;
    border-radius: 0;
    border-inline: 0;
  }

  .assistant-overlay .assistant-panel {
    height: 100dvh;
    max-height: 100dvh;
  }

  .assistant-static-fallback {
    min-height: 0;
    border-radius: 0;
  }

  .assistant-static-fallback > div {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 681px) {
  .assistant-panel--page .assistant-tasks {
    flex-wrap: wrap;
    overflow-x: visible;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  body[data-page="ask"] .portal-header {
    position: relative;
  }

  .assistant-panel--page {
    height: 560px;
    min-height: 560px;
    max-height: none;
  }

  .assistant-launcher {
    right: 12px;
    bottom: 12px;
    width: 54px;
    min-width: 54px;
    padding: 0;
    font-size: 0;
  }

  .assistant-launcher span {
    font-size: 20px;
  }
}

/* PET AI V3 LAYOUT */
.assistant-panel{grid-template-rows:auto auto 68px minmax(0,1fr) auto}.assistant-panel--page{min-height:720px;height:min(860px,calc(100vh - 110px));max-height:900px}.assistant-head__text strong{font-size:18px}.assistant-tasks{height:68px;min-height:68px;max-height:68px;align-items:center}.assistant-tasks button{height:44px;min-height:44px}.assistant-log{background:linear-gradient(180deg,rgba(238,230,218,.38),transparent)}
@media(max-width:680px){.assistant-panel--page{height:calc(100dvh - 68px);max-height:calc(100dvh - 68px);min-height:680px}.assistant-tasks{min-height:66px}.assistant-mode{padding-inline:12px}}

/* PIPL 第23条：向第三方提供须单独同意 —— 放在输入框旁，收集处即告知 */
.assistant-consent{display:flex;gap:8px;align-items:flex-start;margin:10px 0 6px;
  font-size:12px;line-height:1.6;color:#5A6072;cursor:pointer}
.assistant-consent input{margin-top:3px;flex:none;width:14px;height:14px;accent-color:#D4B886}
.assistant-consent a{color:#8E7651;text-decoration:underline}
