:root {
  color-scheme: dark;
  --home-bg: #111214;
  --home-card: rgba(30, 31, 36, 0.92);
  --home-border: rgba(255, 255, 255, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 109, 151, 0.18), transparent 24rem),
    radial-gradient(circle at 80% 0%, rgba(23, 170, 253, 0.16), transparent 22rem),
    var(--home-bg);
  color: #fff;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.home-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 2rem 1rem;
}

.home-card {
  width: min(36rem, 100%);
  padding: 1.25rem;
  border: 1px solid var(--home-border);
  border-radius: 1.25rem;
  background: var(--home-card);
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px);
}

.home-card h1 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
}

.home-card h2 {
  margin: 1.25rem 0 0.65rem;
  color: #c5c5c5;
  font-size: 0.9rem;
  font-weight: 700;
}

.fetch-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6rem;
  gap: 0.6rem;
}

.fetch-form input {
  min-height: 2.7rem;
  border: 1px solid var(--home-border);
  border-radius: 0.85rem;
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  padding: 0 0.85rem;
  outline: none;
}

.fetch-form input:focus {
  border-color: #ff6d97;
}

.fetch-form button,
.role-link,
.chat .chat-bottom .uni-textarea .chat-input-scope .send-btn-icon[data-v-3fc3d0b2] {
  border: 0;
  border-radius: 0.85rem;
  background: #ff6d97;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.home-status {
  min-height: 1.5rem;
  margin-top: 0.7rem;
  color: #c5c5c5;
  font-size: 0.85rem;
  line-height: 1.6;
}

.role-list {
  display: grid;
  gap: 0.5rem;
}

.role-link {
  display: block;
  padding: 0.85rem 0.9rem;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
  transition: background 0.16s ease, transform 0.16s ease;
}

.role-link:hover {
  background: rgba(255, 109, 151, 0.28);
  transform: translateY(-1px);
}

.empty-list {
  padding: 1rem;
  border: 1px dashed var(--home-border);
  border-radius: 0.9rem;
  color: #c5c5c5;
  text-align: center;
}

.chat-page[hidden],
.home-page[hidden] {
  display: none !important;
}

.chat[data-v-3fc3d0b2] {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #17181a;
}

.chat .page-header-scope[data-v-3fc3d0b2] {
  background: #17181a;
}

.local-back {
  color: inherit;
  text-decoration: none;
}

.chat .topTabbar .header-box .icon-back img {
  width: 1.125rem;
  height: 1.125rem;
  object-fit: contain;
}

.chat .topTabbar .local-action-box[data-v-3fc3d0b2] {
  justify-content: flex-end;
  min-width: 3.6rem;
  position: relative;
}

.local-menu-button,
.local-select-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.75rem;
  padding: 0 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 700;
}

.local-menu-button {
  font: inherit;
}

.local-menu-button:active,
.local-select-button:active {
  transform: translateY(1px);
}

.local-menu-panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0.35rem;
  z-index: 50000;
  display: grid;
  width: min(17rem, calc(100vw - 1.4rem));
  gap: 0.55rem;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 1rem;
  background: rgba(23, 24, 26, 0.96);
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.45);
  color: #fff;
  backdrop-filter: blur(12px);
}

.local-menu-panel[hidden] {
  display: none !important;
}

.local-menu-panel label {
  display: grid;
  gap: 0.28rem;
  font-size: 0.76rem;
  font-weight: 700;
}

.local-menu-panel select,
.local-menu-panel input {
  width: 100%;
  min-height: 2.2rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.65rem;
  background: #1e1f24;
  color: #fff;
  padding: 0 0.55rem;
  outline: 0;
}

.local-menu-panel button,
.local-menu-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.1rem;
  border: 0;
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
}

.local-menu-panel button:hover,
.local-menu-link:hover {
  background: rgba(255, 109, 151, 0.28);
}

.chat .topTabbar .header-center .header-role-img img {
  width: 1.5625rem;
  height: 1.5625rem;
  border-radius: 50%;
  object-fit: cover;
  background: #2c2e32;
}

.chat .topTabbar .header-roleName[data-v-3fc3d0b2] {
  color: #fff;
}

.role-sandbox-hidden {
  position: absolute;
  top: -99999px;
  left: 0;
  width: 1px;
  height: 1px;
}

.chat .chat-scope-box[data-v-3fc3d0b2] {
  position: absolute;
  inset: 0;
  background-color: #f6f6f6;
  background-position: center center;
  background-size: auto 100%;
  background-repeat: no-repeat;
}

.chat .chat-scope-box .scroll-view[data-v-3fc3d0b2] {
  position: absolute;
  top: 2.8125rem;
  bottom: 6.75rem;
  left: 0;
  right: 0;
  z-index: 999;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0);
  -webkit-overflow-scrolling: touch;
}

.chat .chat-scope-box .scroll-view .chat-body[data-v-3fc3d0b2] {
  min-height: 100%;
  padding-top: 0.6rem;
  padding-bottom: 6.75rem;
}

.chat .chat-scope-box .scroll-view .chat-body .item[data-v-3fc3d0b2] {
  align-items: flex-start;
  position: relative;
}

.message-pick-label {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  margin: 0.42rem 0.28rem 0 0.12rem;
  border-radius: 999px;
  background: rgba(23, 24, 26, 0.55);
}

.message-pick {
  width: 0.9rem;
  height: 0.9rem;
  margin: 0;
  accent-color: #ff6d97;
}

.chat .chat-scope-box .scroll-view .chat-body .item .avatar[data-v-3fc3d0b2] {
  flex: 0 0 2.4375rem;
  margin-right: 0.5rem;
}

.chat .chat-scope-box .scroll-view .chat-body .item.self .avatar[data-v-3fc3d0b2] {
  margin-right: 0;
  margin-left: 0.5rem;
}

.chat .chat-scope-box .scroll-view .chat-body .item .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat .chat-scope-box .scroll-view .chat-body .item .touch-scope[data-v-3fc3d0b2] {
  min-width: 0;
}

.chat .chat-scope-box .scroll-view .chat-body .item .touch-scope .content[data-v-3fc3d0b2] {
  color: var(--chat-content-font-color, #fff);
  line-height: 1.6;
  word-break: break-word;
  overflow: visible;
}

.chat .chat-scope-box .scroll-view .chat-body .item .touch-scope .content[data-v-3fc3d0b2] p {
  margin: 0 0 0.75rem;
}

.chat .chat-scope-box .scroll-view .chat-body .item .touch-scope .content[data-v-3fc3d0b2] p:last-child {
  margin-bottom: 0;
}

.chat .chat-bottom[data-v-3fc3d0b2],
.chat .chat-bottom .send-msg[data-v-3fc3d0b2] {
  background: #17181a;
}

.chat .chat-bottom[data-v-3fc3d0b2] {
  position: fixed !important;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20000;
  min-height: 5.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -0.75rem 1.5rem rgba(0, 0, 0, 0.32);
}

.chat .chat-bottom .send-msg[data-v-3fc3d0b2] {
  min-height: 5.35rem;
  margin: 0;
  padding: 0.72rem 0.85rem max(0.8rem, env(safe-area-inset-bottom));
}

.chat .chat-bottom .uni-textarea[data-v-3fc3d0b2] {
  width: 100%;
}

.chat .chat-bottom .uni-textarea .chat-input-scope[data-v-3fc3d0b2] {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 3.2rem;
  gap: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.95rem;
  background: var(--input-background-color, #1e1f24);
  padding: 0 0.65rem;
}

.chat .chat-bottom .uni-textarea .chat-input-scope textarea[data-v-3fc3d0b2] {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 2.65rem;
  max-height: 10rem;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--input-font-color, #fff);
  line-height: 1.55;
  padding: 0.65rem 0.25rem;
}

.chat .chat-bottom .uni-textarea .chat-input-scope .send-btn-icon[data-v-3fc3d0b2] {
  flex: 0 0 auto;
  position: relative;
  z-index: 3;
  width: auto;
  min-width: 3.25rem;
  height: 2.15rem;
  padding: 0 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  pointer-events: auto !important;
  touch-action: manipulation;
}

.local-toast {
  position: fixed;
  left: 50%;
  bottom: 6.5rem;
  z-index: 30000;
  max-width: min(34rem, calc(100vw - 2rem));
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.35);
  font-size: 0.86rem;
  transform: translateX(-50%);
}

pre {
  white-space: break-spaces;
}

@media (max-width: 640px) {
  .fetch-form {
    grid-template-columns: 1fr;
  }

  .chat .chat-scope-box .scroll-view[data-v-3fc3d0b2] {
    bottom: 6.25rem;
  }
}

/* ===== 总结设置面板 ===== */
.summary-panel {
  position: fixed;
  inset: 0;
  z-index: 60000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.summary-panel[hidden] {
  display: none !important;
}

.summary-panel-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.summary-panel-card {
  position: relative;
  z-index: 1;
  width: min(26rem, 100%);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 1rem 1.1rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 1.1rem;
  background: rgba(23, 24, 26, 0.98);
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.5);
  color: #fff;
}

.summary-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.summary-panel-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.summary-panel-close {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.summary-panel-close:hover {
  background: rgba(255, 109, 151, 0.35);
}

.summary-panel-body {
  display: grid;
  gap: 0.6rem;
}

.summary-panel-body label {
  display: grid;
  gap: 0.28rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.summary-panel-body input,
.summary-panel-body select {
  width: 100%;
  min-height: 2.3rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.65rem;
  background: #1e1f24;
  color: #fff;
  padding: 0 0.6rem;
  outline: 0;
  font-size: 0.84rem;
}

.summary-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.summary-grow {
  flex: 1 1 auto;
  min-width: 0;
}

.summary-mini-btn {
  flex: 0 0 auto;
  min-height: 2.3rem;
  padding: 0 0.7rem;
  border: 0;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.summary-mini-btn:hover {
  background: rgba(255, 109, 151, 0.3);
}

.summary-save-row,
.summary-action-row {
  display: flex;
  gap: 0.5rem;
}

.summary-panel-body button {
  flex: 1 1 0;
  min-height: 2.3rem;
  border: 0;
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.summary-panel-body button:hover {
  background: rgba(255, 109, 151, 0.3);
}

.summary-primary-btn {
  background: #ff6d97 !important;
}

.summary-divider {
  height: 1px;
  margin: 0.4rem 0;
  background: rgba(255, 255, 255, 0.14);
}

.summary-status {
  min-height: 1.4rem;
  font-size: 0.8rem;
  color: #c5c5c5;
  line-height: 1.5;
  word-break: break-word;
}

.summary-preview {
  max-height: 12rem;
  overflow-y: auto;
  padding: 0.65rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.65rem;
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.82rem;
  line-height: 1.6;
  color: #e6e6e6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ===== 总结预览弹窗 ===== */
.summary-modal {
  position: fixed;
  inset: 0;
  z-index: 70000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.summary-modal[hidden] {
  display: none !important;
}

.summary-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

.summary-modal-card {
  position: relative;
  z-index: 1;
  width: min(32rem, 100%);
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 1.1rem;
  background: rgba(23, 24, 26, 0.98);
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.5);
  color: #fff;
  overflow: hidden;
}

.summary-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.summary-modal-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.summary-modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.9rem 1.1rem;
}

.summary-modal-text {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
  font-size: 0.86rem;
  color: #e6e6e6;
}

.summary-modal-footer {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.summary-modal-footer button {
  flex: 1 1 0;
  min-height: 2.3rem;
  border: 0;
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.summary-modal-footer button:hover {
  background: rgba(255, 109, 151, 0.3);
}

/* ===== 总结预览区 / 历史总结 ===== */
.summary-preview-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.35rem;
}

.summary-history-btn {
  min-height: 2rem;
  padding: 0 0.95rem;
  border: 1px solid rgba(255, 109, 151, 0.5);
  border-radius: 0.65rem;
  background: rgba(255, 109, 151, 0.16);
  color: #ffd0de;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.summary-history-btn:hover {
  background: rgba(255, 109, 151, 0.34);
}

.summary-history-list {
  display: grid;
  gap: 0.7rem;
}

.summary-history-item {
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.65rem;
  background: rgba(0, 0, 0, 0.25);
}

.summary-history-item-meta {
  margin-bottom: 0.4rem;
  color: #9aa0a6;
  font-size: 0.74rem;
}

.summary-history-item-content {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
  font-size: 0.84rem;
  color: #e6e6e6;
}

.summary-history-empty {
  text-align: center;
  color: #9aa0a6;
  padding: 1.5rem 0;
  font-size: 0.86rem;
}
