.yyds-ai-chat-body #wrap {
  background: #f3f5f7;
}

.yyds-ai-chat-body .wrap.container {
  max-width: none;
  padding: 0;
  width: 100%;
}

.yyds-ai-chat-body .main {
  float: none;
  margin: 0;
  max-width: none;
  width: 100%;
}

.yyds-ai-chat-body .entry-main {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.yyds-ai-chat-body .entry-head,
.yyds-ai-chat-body .breadcrumb,
.yyds-ai-chat-body .sidebar {
  display: none !important;
}

.yyds-ai-chat-body .entry-content {
  margin: 0;
  padding: 0;
}

.yyds-ai-chat-page,
.yyds-ai-chat-page * {
  box-sizing: border-box;
}

.yyds-ai-chat-page {
  color: #111827;
  display: grid;
  gap: 18px;
  grid-template-columns: 320px minmax(0, 1fr);
  margin: 28px auto 46px;
  max-width: 1220px;
  padding: 0 14px;
}

.yyds-ai-chat-side,
.yyds-ai-chat-main {
  background: #fff;
  border: 1px solid #e8edf3;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(17, 24, 39, .05);
}

.yyds-ai-chat-side {
  align-self: start;
  display: grid;
  gap: 16px;
  padding: 20px;
  position: sticky;
  top: 82px;
}

.yyds-ai-chat-brand span {
  background: rgba(47, 150, 63, .12);
  border-radius: 999px;
  color: #2f963f;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  line-height: 28px;
  padding: 0 12px;
}

.yyds-ai-chat-brand h1 {
  color: #111827;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.18;
  margin: 14px 0 0;
}

.yyds-ai-chat-model {
  position: relative;
  display: grid;
  gap: 10px;
}

.yyds-ai-chat-model span {
  color: #6b7280;
  font-size: 13px;
}

.yyds-ai-model-current {
  background: linear-gradient(135deg, rgba(47, 150, 63, .12), rgba(37, 99, 235, .08));
  border: 1px solid #cfe1d4;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(47, 150, 63, .08);
  color: #111827;
  cursor: pointer;
  display: grid;
  gap: 4px;
  min-height: 62px;
  padding: 11px 40px 11px 12px;
  position: relative;
  text-align: left;
  width: 100%;
}

.yyds-ai-model-current::after {
  border-color: #2f963f transparent transparent;
  border-style: solid;
  border-width: 6px 5px 0;
  content: "";
  position: absolute;
  right: 16px;
  top: 28px;
}

.yyds-ai-model-current[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.yyds-ai-model-current strong {
  font-size: 14px;
  line-height: 1.35;
}

.yyds-ai-model-current small {
  color: #64748b;
  font-size: 12px;
}

.yyds-ai-model-options {
  background: #fff;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, .14);
  display: grid;
  gap: 8px;
  left: 0;
  max-height: 330px;
  overflow-y: auto;
  padding: 8px;
  position: absolute;
  right: 0;
  top: 86px;
  z-index: 20;
}

.yyds-ai-model-options[hidden] {
  display: none !important;
}

.yyds-ai-model-options button {
  background:
    linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(17, 24, 39, .04);
  color: #111827;
  cursor: pointer;
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 11px 12px;
  position: relative;
  text-align: left;
}

.yyds-ai-model-options button:hover {
  border-color: #2f963f;
  transform: translateY(-1px);
}

.yyds-ai-model-options button.is-active {
  background: linear-gradient(135deg, rgba(47, 150, 63, .12), rgba(37, 99, 235, .10));
  border-color: #2f963f;
  box-shadow: inset 4px 0 0 #2f963f, 0 8px 18px rgba(47, 150, 63, .12);
}

.yyds-ai-model-options button.is-active::after {
  align-items: center;
  background: #2f963f;
  border-radius: 999px;
  color: #fff;
  content: "已选";
  display: flex;
  font-size: 11px;
  font-weight: 900;
  height: 22px;
  padding: 0 8px;
  position: absolute;
  right: 10px;
  top: 10px;
}

.yyds-ai-model-options strong {
  font-size: 14px;
  line-height: 1.35;
  padding-right: 44px;
}

.yyds-ai-model-options small {
  color: #64748b;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.yyds-ai-chat-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.yyds-ai-chat-actions button,
.yyds-ai-chat-actions a,
.yyds-ai-chat-admin-link {
  align-items: center;
  border-radius: 7px;
  display: flex;
  font-size: 14px;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  text-decoration: none;
}

.yyds-ai-chat-actions button {
  background: #2f963f;
  border: 0;
  color: #fff;
  cursor: pointer;
}

.yyds-ai-chat-actions a,
.yyds-ai-chat-admin-link {
  background: #f8fafc;
  border: 1px solid #dbe4ef;
  color: #1f2937;
}

.yyds-ai-history {
  border-top: 1px solid #edf1f5;
  display: grid;
  gap: 10px;
  padding-top: 14px;
}

.yyds-ai-history-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.yyds-ai-history-head span {
  color: #111827;
  font-size: 14px;
  font-weight: 900;
}

.yyds-ai-history-head button {
  background: transparent;
  border: 0;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 0;
}

.yyds-ai-history-head button:hover {
  color: #ef4444;
}

.yyds-ai-history-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 2px;
}

.yyds-ai-history-row {
  align-items: stretch;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) 34px;
}

.yyds-ai-history-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #111827;
  cursor: pointer;
  display: grid;
  gap: 4px;
  min-height: 56px;
  padding: 10px;
  text-align: left;
  width: 100%;
}

.yyds-ai-history-row:hover .yyds-ai-history-item {
  border-color: #2f963f;
}

.yyds-ai-history-row.is-active .yyds-ai-history-item {
  background: #eef6ff;
  border-color: #2563eb;
  box-shadow: inset 3px 0 0 #2563eb;
}

.yyds-ai-history-item strong {
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yyds-ai-history-item small,
.yyds-ai-history-empty {
  color: #64748b;
  font-size: 12px;
}

.yyds-ai-history-delete {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #94a3b8;
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.yyds-ai-history-delete:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #ef4444;
}

.yyds-ai-chat-main {
  display: grid;
  grid-template-rows: minmax(520px, 68vh) auto;
  min-height: 660px;
  overflow: hidden;
}

.yyds-ai-chat-thread {
  background:
    linear-gradient(180deg, rgba(47, 150, 63, .05), transparent 210px),
    #fbfcfe;
  overflow-y: auto;
  padding: 22px;
}

.yyds-ai-message {
  display: flex;
  margin: 0 0 16px;
}

.yyds-ai-message:last-child {
  margin-bottom: 0;
}

.yyds-ai-message.user {
  justify-content: flex-end;
}

.yyds-ai-bubble {
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.78;
  max-width: min(760px, 86%);
  padding: 12px 15px;
  white-space: pre-wrap;
  word-break: break-word;
}

.yyds-ai-message.assistant .yyds-ai-bubble {
  background: #fff;
  border: 1px solid #e8edf3;
  color: #1f2937;
}

.yyds-ai-message.user .yyds-ai-bubble {
  background: #2f963f;
  color: #fff;
}

.yyds-ai-message.loading .yyds-ai-bubble::after {
  animation: yyds-ai-dots 1.2s infinite;
  content: " ...";
}

.yyds-ai-message.typing .yyds-ai-bubble::after {
  animation: yyds-ai-cursor 1s steps(2, start) infinite;
  color: #2f963f;
  content: "|";
  font-weight: 900;
  margin-left: 2px;
}

.yyds-ai-chat-composer {
  background: #fff;
  border-top: 1px solid #e8edf3;
  display: grid;
  gap: 10px;
  padding: 14px;
}

.yyds-ai-composer-row {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: 136px minmax(0, 1fr) 86px;
}

.yyds-ai-upload {
  align-items: center;
  appearance: none;
  background: linear-gradient(135deg, #111827, #2563eb);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
  color: #fff;
  cursor: pointer;
  display: flex;
  gap: 9px;
  height: 46px;
  justify-content: center;
  padding: 0 12px;
  text-decoration: none;
  width: 100%;
}

.yyds-ai-upload:hover {
  box-shadow: 0 10px 22px rgba(37, 99, 235, .24);
  color: #fff;
  transform: translateY(-1px);
}

.yyds-ai-file-input {
  height: 1px !important;
  left: -9999px !important;
  opacity: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  position: absolute !important;
  width: 1px !important;
}

.yyds-ai-upload-icon {
  align-items: center;
  background: rgba(255, 255, 255, .18);
  border-radius: 999px;
  display: flex;
  flex: 0 0 24px;
  font-size: 20px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  line-height: 1;
  width: 24px;
}

.yyds-ai-upload-text {
  display: grid;
  gap: 1px;
  line-height: 1.1;
}

.yyds-ai-upload-text strong {
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.yyds-ai-upload-text small {
  color: rgba(255, 255, 255, .78);
  font-size: 11px;
  font-weight: 800;
}

.yyds-ai-file-list {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
}

.yyds-ai-file-list.is-visible {
  display: flex;
}

.yyds-ai-file-chip {
  background: #eef6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #1d4ed8;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  line-height: 28px;
  max-width: 220px;
  overflow: hidden;
  padding: 0 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yyds-ai-file-chip::after {
  content: " ×";
  font-weight: 900;
}

.yyds-ai-chat-composer textarea {
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  color: #111827;
  font-size: 15px;
  line-height: 1.6;
  max-height: 160px;
  min-height: 46px;
  padding: 10px 12px;
  resize: none;
  width: 100%;
}

.yyds-ai-chat-composer textarea:focus {
  border-color: #2f963f;
  box-shadow: 0 0 0 3px rgba(47, 150, 63, .12);
  outline: 0;
}

.yyds-ai-chat-composer button[data-ai-send] {
  background: #2f963f;
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
  height: 46px;
}

.yyds-ai-upload-note {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.yyds-ai-chat-composer button[data-ai-send]:disabled {
  cursor: not-allowed;
  opacity: .58;
}

@keyframes yyds-ai-dots {
  0%, 20% { color: rgba(31, 41, 55, .2); }
  50% { color: rgba(31, 41, 55, .7); }
  100% { color: rgba(31, 41, 55, .2); }
}

@keyframes yyds-ai-cursor {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}

@media (max-width: 900px) {
  .yyds-ai-chat-page {
    grid-template-columns: 1fr;
    margin-top: 18px;
  }

  .yyds-ai-chat-side {
    position: static;
  }

  .yyds-ai-chat-main {
    grid-template-rows: minmax(460px, 66vh) auto;
    min-height: 580px;
  }
}

@media (max-width: 640px) {
  .yyds-ai-chat-page {
    gap: 12px;
    margin: 10px auto 28px;
    padding: 0 10px;
  }

  .yyds-ai-chat-side,
  .yyds-ai-chat-main {
    border-radius: 8px;
  }

  .yyds-ai-chat-side {
    gap: 14px;
    padding: 16px;
  }

  .yyds-ai-chat-brand {
    align-items: center;
    display: flex;
    gap: 12px;
  }

  .yyds-ai-chat-brand span {
    flex: 0 0 auto;
  }

  .yyds-ai-chat-brand h1 {
    font-size: 22px;
    margin: 0;
  }

  .yyds-ai-chat-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .yyds-ai-chat-thread {
    padding: 14px;
  }

  .yyds-ai-chat-main {
    grid-template-rows: minmax(430px, 64vh) auto;
    min-height: 540px;
  }

  .yyds-ai-bubble {
    font-size: 14px;
    max-width: 92%;
  }

  .yyds-ai-chat-composer {
    grid-template-columns: 1fr;
  }

  .yyds-ai-composer-row {
    grid-template-columns: 108px minmax(0, 1fr);
  }

  .yyds-ai-composer-row button[data-ai-send] {
    grid-column: 1 / -1;
    width: 100%;
  }
}
