*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, "PingFang SC", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: #0a0e17;
  color: #f1f5f9;
  -webkit-font-smoothing: antialiased;
}

#app {
  height: 100dvh;
  width: 100%;
  background: #111827;
  position: relative;
  overflow: hidden;
}
@media (max-width: 767px) {
  #app {
    max-width: 480px;
    margin: 0 auto;
  }
}

.ch-layout {
  display: flex;
  height: 100%;
}

.ch-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  height: 100%;
}

.ch-sidebar {
  display: none;
  flex-direction: column;
  border-left: 1px solid #1e293b;
  background: #0f172a;
  overflow: hidden;
  transition: width 0.25s ease;
  width: 320px;
  min-width: 0;
}
.ch-sidebar--collapsed {
  width: 0;
  border-left-color: transparent;
}
.ch-sidebar--collapsed .ch-sidebar-body {
  display: none;
}
@media (max-width: 767px) {
  .ch-sidebar {
    display: none !important;
  }
}
@media (min-width: 768px) {
  .ch-sidebar {
    display: flex;
  }
}

.ch-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.15s;
}
.ch-sidebar-header:hover {
  background: #1a2236;
}
.ch-sidebar-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: #f1f5f9;
}

.ch-sidebar-chevron {
  color: #475569;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.ch-sidebar--collapsed .ch-sidebar-chevron {
  transform: rotate(180deg);
}

.ch-sidebar-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ch-sidebar-status {
  padding: 24px 16px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}

.ch-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  text-decoration: none;
  color: #f1f5f9;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: background 0.15s;
}
.ch-sidebar-item:hover, .ch-sidebar-item--active {
  background: #1a2236;
}

.ch-sidebar-item-avatar-wrap,
.ch-menu-item-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ch-sidebar-item-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  flex-shrink: 0;
  background: #1e293b;
}

.ch-press-ring {
  position: absolute;
  inset: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  transform: rotate(-90deg);
  pointer-events: none;
}

.ch-press-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 2;
}

.ch-press-ring-fg {
  fill: none;
  stroke: #a78bfa;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 113.097;
  stroke-dashoffset: 113.097;
  transition: none;
}

.ch-sidebar-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ch-sidebar-item-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-sidebar-item-preview {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-sidebar-item-time {
  font-size: 10px;
  color: #475569;
  flex-shrink: 0;
}

.ch-pin-icon {
  flex-shrink: 0;
  vertical-align: middle;
  margin-right: 3px;
  color: #a78bfa;
}

.ch-context-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: transparent;
}

.ch-context-menu {
  position: fixed;
  z-index: 201;
  min-width: 180px;
  background: #1a2236;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 4px 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.ch-context-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: #f1f5f9;
  cursor: pointer;
  transition: background 0.12s;
  user-select: none;
}
.ch-context-item svg {
  flex-shrink: 0;
  color: #94a3b8;
}
.ch-context-item:hover {
  background: rgba(255, 255, 255, 0.06);
}
.ch-context-item--danger {
  color: #ef4444;
}
.ch-context-item--danger svg {
  color: #ef4444;
}
.ch-context-item--danger:hover {
  background: rgba(239, 68, 68, 0.12);
}

.ch-context-divider {
  height: 1px;
  background: #1e293b;
  margin: 4px 0;
}

.ch-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 300;
  animation: fade-in 0.15s ease-out;
}

.ch-confirm-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 301;
  background: #1a2236;
  border: 1px solid #1e293b;
  border-radius: 16px;
  padding: 24px;
  min-width: 280px;
  max-width: 320px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  animation: confirm-in 0.2s ease-out;
}

@keyframes confirm-in {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
.ch-confirm-text {
  font-size: 15px;
  line-height: 1.5;
  color: #f1f5f9;
  margin-bottom: 20px;
  text-align: center;
}

.ch-confirm-actions {
  display: flex;
  gap: 10px;
}

.ch-confirm-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  font-family: inherit;
}
.ch-confirm-btn:active {
  transform: scale(0.96);
}
.ch-confirm-btn--cancel {
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
}
.ch-confirm-btn--cancel:hover {
  background: rgba(255, 255, 255, 0.1);
}
.ch-confirm-btn--danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
.ch-confirm-btn--danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

#character-chat-app {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  position: relative;
  z-index: 1;
}

.ch-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #1a2236;
  border-bottom: 1px solid #1e293b;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.ch-header .ch-back {
  color: #94a3b8;
  text-decoration: none;
  display: flex;
  padding: 4px;
  transition: color 0.2s;
}
.ch-header .ch-back:hover {
  color: #a78bfa;
}
.ch-header .ch-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 2px solid #a78bfa;
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.35);
  flex-shrink: 0;
}
.ch-header .ch-user {
  flex: 1;
  min-width: 0;
}
.ch-header .ch-name {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-header .ch-status {
  font-size: 12px;
  color: #34d399;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ch-header .ch-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}
.ch-hamburger {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  display: flex;
  transition: color 0.2s;
  flex-shrink: 0;
}
.ch-hamburger:hover {
  color: #a78bfa;
}

.ch-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  animation: fade-in 0.2s ease-out;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.ch-menu-sheet {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  max-width: 85vw;
  height: 100%;
  background: #111827;
  border-left: 1px solid #1e293b;
  z-index: 101;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease-out;
}
.ch-menu-sheet--open {
  transform: translateX(0);
}

.ch-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
}
.ch-menu-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: #f1f5f9;
}

.ch-menu-close {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  display: flex;
}
.ch-menu-close:hover {
  color: #f1f5f9;
}

.ch-menu-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
}

.ch-menu-loading,
.ch-menu-empty {
  padding: 24px 16px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}

.ch-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: #f1f5f9;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: background 0.15s;
}
.ch-menu-item:hover {
  background: #1a2236;
}

.ch-menu-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  flex-shrink: 0;
  background: #1e293b;
  display: block;
}

.ch-menu-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ch-menu-item-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-menu-item-preview {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-menu-item-time {
  font-size: 11px;
  color: #475569;
  flex-shrink: 0;
}

.ch-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 768px) {
  .ch-messages {
    padding: 24px 48px;
  }
}

.ch-msg {
  display: flex;
  animation: msg-in 0.25s ease-out;
}
.ch-msg--me {
  justify-content: flex-end;
}
.ch-msg--them {
  justify-content: flex-start;
}
.ch-msg + .ch-msg {
  margin-top: -4px;
}

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.ch-bubble {
  max-width: 82%;
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
}
@media (min-width: 768px) {
  .ch-bubble {
    max-width: 60%;
    font-size: 16px;
    padding: 14px 20px;
  }
}

.ch-msg--me .ch-bubble {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: #fff;
  border-radius: 20px 20px 4px 20px;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}

.ch-msg--them .ch-bubble {
  background: #1e293b;
  color: #f1f5f9;
  border-radius: 20px 20px 20px 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.ch-bubble--typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 14px 20px;
  min-width: 64px;
  justify-content: center;
}

.ch-retry-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.08);
  border-top: 1px solid rgba(239, 68, 68, 0.15);
  border-bottom: 1px solid rgba(239, 68, 68, 0.15);
  flex-shrink: 0;
  animation: fade-in 0.25s ease-out;
}

.ch-retry-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.ch-retry-text {
  flex: 1;
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.3;
}

.ch-retry-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
  font-family: inherit;
}
.ch-retry-btn:hover {
  opacity: 0.85;
}
.ch-retry-btn--retry {
  background: #a78bfa;
  color: #fff;
}
.ch-retry-btn--cancel {
  background: transparent;
  color: #94a3b8;
  border: 1px solid #1e293b;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #475569;
  animation: bounce 1.4s ease-in-out infinite;
}
.dot-2 {
  animation-delay: 0.2s;
}
.dot-3 {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: translateY(0);
    background: #475569;
  }
  40% {
    transform: translateY(-6px);
    background: #a78bfa;
  }
}
.ch-input {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: #1a2236;
  border-top: 1px solid #1e293b;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}
@media (min-width: 768px) {
  .ch-input {
    padding: 16px 48px;
  }
}
.ch-input textarea {
  flex: 1;
  background: #0a0e17;
  border: 1px solid #1e293b;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 15px;
  color: #f1f5f9;
  resize: none;
  outline: none;
  line-height: 1.4;
  max-height: 100px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ch-input textarea::placeholder {
  color: #475569;
}
.ch-input textarea:focus {
  border-color: #a78bfa;
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.35);
}
.ch-input textarea:disabled {
  opacity: 0.5;
}
.ch-input .ch-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.3);
}
.ch-input .ch-send:hover:not(:disabled) {
  transform: scale(1.08);
  box-shadow: 0 3px 16px rgba(124, 58, 237, 0.45);
}
.ch-input .ch-send:active:not(:disabled) {
  transform: scale(0.92);
}
.ch-input .ch-send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

[v-cloak] {
  display: none;
}

.ch-messages::-webkit-scrollbar {
  width: 4px;
}

.ch-messages::-webkit-scrollbar-track {
  background: transparent;
}

.ch-messages::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

.ch-sidebar-body::-webkit-scrollbar {
  width: 4px;
}

.ch-sidebar-body::-webkit-scrollbar-track {
  background: transparent;
}

.ch-sidebar-body::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

/*# sourceMappingURL=character-chat.css.map */
