/* Portal Lite · Apollo-Portal-prompt v5 对齐 */

:root {
  --lite-bg: #0c0c0e;
  --lite-sidebar: #111113;
  --lite-border: #1c1c1e;
  --lite-surface: #151517;
  --lite-text: #e8e8ed;
  --lite-text-dim: #6b7280;
  --lite-accent: #6366f1;
  --lite-accent-hover: #5558e6;
  --font: "DM Sans", system-ui, sans-serif;
}

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

html,
body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  background: var(--lite-bg);
  color: var(--lite-text);
  -webkit-font-smoothing: antialiased;
}

.lite-app {
  height: 100%;
  padding-top: env(safe-area-inset-top, 0);
}

.skip-link.lite-skip {
  position: absolute;
  left: 8px;
  top: max(8px, env(safe-area-inset-top, 0px));
  padding: 0.5rem 1rem;
  background: #27272a;
  color: #fafafa;
  font-weight: 600;
  border-radius: 8px;
  z-index: 300;
  transform: translateY(-200%);
  transition: transform 0.2s ease;
  text-decoration: none;
  font-size: 13px;
}

.skip-link.lite-skip:focus {
  transform: translateY(0);
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

.lite-shell {
  display: flex;
  height: 100%;
  min-height: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* —— Sidebar —— */
.lite-sidebar {
  width: 256px;
  flex-shrink: 0;
  background: var(--lite-sidebar);
  border-right: 1px solid var(--lite-border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  z-index: 40;
}

.lite-back-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 16px 0;
}

.lite-sidebar-back {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: #4b5563;
  text-decoration: none;
  transition: color 0.15s ease;
}

.lite-sidebar-back:hover {
  color: #a1a1aa;
}

.lite-sidebar-back-pro {
  color: #a5b4fc;
}

.lite-sidebar-back-pro:hover {
  color: #c7d2fe;
}

.lite-header-return-pro {
  flex-shrink: 0;
  margin-right: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #a5b4fc;
  text-decoration: none;
  border: 1px solid rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.12);
  transition: background 0.15s, color 0.15s;
}

.lite-header-return-pro:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #e0e7ff;
}

.logo-container {
  padding: 8px 16px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  flex-shrink: 0;
}

.logo-icon svg {
  display: none;
}

.logo-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.logo-text {
  font-size: 15px;
  font-weight: 500;
  color: #e8e8ed;
  letter-spacing: -0.2px;
}

.logo-subtext {
  font-size: 9px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.new-chat-btn {
  width: calc(100% - 32px);
  margin: 0 16px 16px;
  padding: 10px 14px;
  background: #6366f1;
  border: none;
  border-radius: 7px;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
  transition: background 0.2s, transform 0.15s;
}

.new-chat-btn:hover {
  background: #5558e6;
  transform: translateY(-1px);
}

.search-box {
  margin: 0 12px 12px;
  position: relative;
}

.search-input {
  width: 100%;
  background: #1a1a1c;
  border: 1px solid #1c1c1e;
  border-radius: 6px;
  padding: 8px 12px 8px 32px;
  font-size: 12px;
  color: #e8e8ed;
  font-family: inherit;
  transition: border-color 0.15s;
}

.search-input:focus {
  outline: none;
  border-color: #374151;
}

.search-input::placeholder {
  color: #4b5563;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  color: #4b5563;
  pointer-events: none;
}

.history-section {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 8px;
  min-height: 0;
}

.history-title {
  font-size: 11px;
  font-weight: 500;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 10px;
  margin-bottom: 8px;
}

/* 会话行：删除钮浮在标签右上，悬停/聚焦时浮现 */
.history-row {
  position: relative;
  margin-bottom: 2px;
}

.history-row .history-item {
  width: 100%;
  margin-bottom: 0;
  padding-right: 72px;
}

.history-rename {
  position: absolute;
  right: 40px;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, color 0.15s, background 0.15s;
}

.history-row:hover .history-rename,
.history-row:focus-within .history-rename,
.history-rename:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

.history-rename:hover {
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.12);
}

.history-title-input {
  display: block;
  width: calc(100% - 8px);
  margin: 2px 0 4px;
  box-sizing: border-box;
  font-size: 13px;
  font-weight: 500;
  color: #e8e8ed;
  background: #0f0f11;
  border: 1px solid #6366f1;
  border-radius: 6px;
  padding: 4px 8px;
  outline: none;
}

.history-delete {
  position: absolute;
  right: 6px;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%) translateX(4px) scale(0.92);
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(22, 22, 24, 0.92);
  color: #9ca3af;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, color 0.15s, border-color 0.15s,
    background 0.15s, box-shadow 0.18s ease;
}

.history-row:hover .history-delete,
.history-row:focus-within .history-delete {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0) scale(1);
}

/* 触屏：无 hover 时也保留较弱可见，避免找不到删除 */
@media (hover: none) {
  .history-delete {
    opacity: 0.55;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0) scale(1);
  }

  .history-row:active .history-delete {
    opacity: 1;
  }
}

.history-delete:hover {
  color: #fecaca;
  background: rgba(60, 20, 24, 0.95);
  border-color: rgba(248, 113, 113, 0.45);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(248, 113, 113, 0.2);
}

.history-delete:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0) scale(1);
}

.history-row.is-active .history-delete {
  background: rgba(30, 30, 33, 0.94);
  border-color: rgba(255, 255, 255, 0.1);
}

.history-delete-icon {
  flex-shrink: 0;
  pointer-events: none;
}

.history-item {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #6b7280;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  margin-bottom: 2px;
}

.history-item:hover {
  background: #151517;
  color: #a1a1aa;
}

.history-item.active {
  background: #1c1c1e;
  border-color: #2a2a2c;
  color: #e8e8ed;
}

.history-item-icon {
  width: 14px;
  height: 14px;
  opacity: 0.4;
  flex-shrink: 0;
  margin-top: 2px;
}

.history-item-text {
  flex: 1;
  min-width: 0;
}

.history-item-title {
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-meta {
  font-size: 10px;
  color: #4b5563;
  margin-top: 2px;
}

.lite-history-empty {
  margin: 8px 10px 0;
  padding: 12px 10px;
  border-radius: 8px;
  border: 1px dashed #2a2a2c;
  font-size: 12px;
  line-height: 1.5;
  color: #6b7280;
  text-align: center;
}

/* 删除会话确认弹窗 */
.lite-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

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

.lite-modal-panel {
  width: 100%;
  max-width: 400px;
  padding: 22px 22px 18px;
  border-radius: 14px;
  border: 1px solid var(--lite-border);
  background: var(--lite-sidebar);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.lite-modal-title {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 700;
  color: var(--lite-text);
  letter-spacing: -0.02em;
}

.lite-modal-body {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.55;
  color: #a1a1aa;
}

.lite-modal-note {
  margin: 0 0 20px;
  font-size: 12px;
  line-height: 1.45;
  color: #6b7280;
}

.lite-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.lite-modal-btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.lite-modal-btn-secondary {
  background: #1c1c1e;
  border-color: #2a2a2c;
  color: #e8e8ed;
}

.lite-modal-btn-secondary:hover {
  background: #252528;
}

.lite-modal-btn-danger {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

.lite-modal-btn-danger:hover {
  background: rgba(220, 38, 38, 0.35);
}

/* —— Main —— */
.lite-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--lite-bg);
}

.chat-header {
  height: 48px;
  border-bottom: 1px solid var(--lite-border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  flex-shrink: 0;
}

.chat-header-actions {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-toggle {
  display: none;
  padding: 6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #4b5563;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle:hover {
  background: #1c1c1e;
  color: #e8e8ed;
}

@media (max-width: 768px) {
  .sidebar-toggle {
    display: inline-flex;
  }

  .lite-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100%;
  }

  .lite-sidebar.is-collapsed {
    transform: translateX(-100%);
    box-shadow: none;
  }

  .lite-sidebar:not(.is-collapsed) {
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.4);
  }

  .lite-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 30;
  }

  .lite-sidebar-overlay.is-visible {
    display: block;
  }
}

.chat-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.chat-title {
  font-size: 13px;
  font-weight: 500;
  color: #e8e8ed;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-meta {
  font-size: 10px;
  color: #4b5563;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px;
  min-height: 0;
  overflow-anchor: auto;
}

.message-list {
  max-width: 768px;
  margin: 0 auto;
}

.message-wrapper {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  max-width: 768px;
  margin-left: auto;
  margin-right: auto;
}

/* 仅新插入的消息淡入，避免整表重绘时全屏闪动 */
.message-wrapper.is-entering {
  animation: liteMessageIn 0.26s ease-out;
}

@keyframes liteMessageIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .message-wrapper.is-entering {
    animation: none;
  }
}

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

.message-wrapper.assistant {
  justify-content: flex-start;
}

.message-inner {
  display: flex;
  gap: 12px;
  max-width: 85%;
  align-items: flex-end;
}

.message-wrapper.user .message-inner {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

.message-avatar.user [data-avatar-img] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.message-avatar.user {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.15));
  border: 1px solid #2a2a2c;
  color: #93c5fd;
  padding: 0;
}

.message-avatar.assistant {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(6, 182, 212, 0.2));
  border: 1px solid #2a2a2c;
  color: #818cf8;
}

.message-bubble {
  max-width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-bubble.apollo-md {
  white-space: normal;
}

.message-bubble.user {
  background: #6366f1;
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.message-bubble.assistant {
  background: #151517;
  border: 1px solid #1c1c1e;
  color: #d4d4d8;
  border-bottom-left-radius: 4px;
}

.message-time {
  font-size: 10px;
  margin-top: 8px;
  opacity: 0.75;
}

.message-time.user {
  color: rgba(255, 255, 255, 0.65);
  text-align: right;
}

.message-time.assistant {
  color: #4b5563;
}

.empty-state {
  height: 100%;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.empty-state[hidden] {
  display: none !important;
}

.empty-icon {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.16), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(129, 140, 248, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  padding: 4px;
  box-sizing: border-box;
  overflow: visible;
  box-shadow:
    0 0 0 1px rgba(99, 102, 241, 0.08) inset,
    0 12px 32px rgba(99, 102, 241, 0.12);
  animation: lite-empty-breathe 3.6s ease-in-out infinite;
}

.lite-empty-mark__aura {
  position: absolute;
  inset: -10px;
  border-radius: 22px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.28) 0%, rgba(34, 211, 238, 0.08) 42%, transparent 72%);
  opacity: 0.45;
  animation: lite-empty-aura 3.6s ease-in-out infinite;
  pointer-events: none;
}

.lite-empty-mark__aura--delay {
  inset: -18px;
  animation-delay: 1.2s;
  opacity: 0.28;
}

.lite-empty-mark__svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.35));
}

.lite-empty-mark__grid {
  animation: lite-empty-grid 3.6s ease-in-out infinite;
}

.lite-empty-mark__arc {
  stroke-dasharray: 52;
  stroke-dashoffset: 52;
  animation: lite-empty-draw 2.8s ease-in-out infinite;
}

.lite-empty-mark__node {
  animation: lite-empty-node 3.6s ease-in-out infinite;
}

.lite-empty-mark__node--2 {
  animation-delay: 0.3s;
}

.lite-empty-mark__node--3 {
  animation-delay: 0.6s;
}

.lite-empty-mark__node--4 {
  animation-delay: 0.9s;
}

.lite-empty-mark__core-glow {
  animation: lite-empty-core 3.6s ease-in-out infinite;
}

.lite-empty-mark__spark {
  transform-origin: 24px 15.2px;
  animation: lite-empty-spark 3.6s ease-in-out infinite;
}

@keyframes lite-empty-breathe {
  0%,
  100% {
    opacity: 0.82;
    box-shadow:
      0 0 0 1px rgba(99, 102, 241, 0.08) inset,
      0 8px 24px rgba(99, 102, 241, 0.1);
    border-color: rgba(129, 140, 248, 0.18);
  }
  50% {
    opacity: 1;
    box-shadow:
      0 0 0 1px rgba(129, 140, 248, 0.22) inset,
      0 0 28px rgba(99, 102, 241, 0.28),
      0 16px 40px rgba(34, 211, 238, 0.14);
    border-color: rgba(129, 140, 248, 0.42);
  }
}

@keyframes lite-empty-aura {
  0%,
  100% {
    opacity: 0.28;
    transform: scale(0.94);
  }
  50% {
    opacity: 0.72;
    transform: scale(1.06);
  }
}

@keyframes lite-empty-grid {
  0%,
  100% {
    stroke-opacity: 0.22;
  }
  50% {
    stroke-opacity: 0.55;
  }
}

@keyframes lite-empty-draw {
  0%,
  18% {
    stroke-dashoffset: 52;
    opacity: 0.35;
  }
  45%,
  70% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
  100% {
    stroke-dashoffset: -8;
    opacity: 0.55;
  }
}

@keyframes lite-empty-node {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

@keyframes lite-empty-core {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.85;
  }
}

@keyframes lite-empty-spark {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.92) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.06) rotate(8deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .empty-icon,
  .lite-empty-mark__aura,
  .lite-empty-mark__grid,
  .lite-empty-mark__arc,
  .lite-empty-mark__node,
  .lite-empty-mark__core-glow,
  .lite-empty-mark__spark {
    animation: none !important;
  }

  .lite-empty-mark__arc {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

.empty-icon:not(.lite-empty-mark) svg {
  width: 28px;
  height: 28px;
  color: #818cf8;
}

.empty-title {
  font-size: 18px;
  font-weight: 500;
  color: #e8e8ed;
  margin: 0 0 8px;
  letter-spacing: -0.2px;
}

.empty-subtitle {
  font-size: 14px;
  color: #6b7280;
  max-width: 400px;
  margin: 0;
  line-height: 1.7;
}

.input-container {
  padding: 12px 16px;
  border-top: 1px solid #1c1c1e;
  flex-shrink: 0;
}

.asr-candidates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  max-width: 768px;
  margin: 8px auto 0;
  font-size: 11px;
  color: #71717a;
}
.asr-candidates[hidden] { display: none !important; }
.asr-candidates .asr-cand-label { margin-right: 4px; }
.asr-candidates .asr-cand-chip {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #27272a;
  background: #151517;
  color: #a1a1aa;
  cursor: pointer;
  font-size: 11px;
}
.asr-candidates .asr-cand-chip:hover {
  border-color: #3b82f6;
  color: #93c5fd;
}

.input-wrapper {
  max-width: 768px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.input-box {
  flex: 1;
  position: relative;
}

.input-textarea {
  width: 100%;
  min-height: 44px;
  max-height: 200px;
  resize: none;
  background: #151517;
  border: 1px solid #1c1c1e;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  color: #d4d4d8;
  line-height: 1.5;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-textarea:focus {
  outline: none;
  border-color: #374151;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-textarea::placeholder {
  color: #4b5563;
}

.send-button {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: none;
  background: #6366f1;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}

.send-button:hover:not(:disabled) {
  background: #5558e6;
}

.send-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.send-button:active:not(:disabled) {
  transform: scale(0.95);
}

/* 触屏：放大主要点击目标（约 44×44pt） */
@media (pointer: coarse) {
  .sidebar-toggle {
    min-width: 44px;
    min-height: 44px;
  }

  .send-button {
    min-width: 44px;
    min-height: 44px;
  }

  .new-chat-btn {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lite-sidebar,
  .message-wrapper {
    animation: none;
    transition: none;
  }
}

/* ── 语音输入 & 语音输出（Lite） ── */
.lite-voice-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid #1c1c1e;
  background: #151517;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.lite-voice-btn:hover {
  background: #1c1c1e;
  color: #d4d4d8;
  border-color: #374151;
}
.lite-voice-btn:active {
  transform: scale(0.95);
}
.lite-voice-btn.is-recording {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ef4444;
  animation: lite-voice-pulse 1.2s ease-in-out infinite;
}
@keyframes lite-voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}
.lite-tts-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 4px;
  margin-left: 2px;
  opacity: 0.5;
  color: #6b7280;
  transition: all 0.15s ease;
  user-select: none;
}
.lite-tts-btn:hover {
  opacity: 1;
  background: rgba(99, 102, 241, 0.08);
  color: #6366f1;
}
.lite-tts-btn:active {
  opacity: 0.3;
}
.lite-tts-btn.is-playing {
  opacity: 1;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
}
.lite-tts-btn.is-paused {
  opacity: 0.6;
  color: #6b7280;
  background: rgba(99, 102, 241, 0.05);
}
.lite-tts-btn.is-playing .tts-wave-1 {
  animation: lite-tts-wave 0.8s ease-in-out infinite;
}
.lite-tts-btn.is-playing .tts-wave-2 {
  animation: lite-tts-wave 0.8s ease-in-out 0.2s infinite;
}
@keyframes lite-tts-wave {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
.lite-tts-btn .tts-wave-1,
.lite-tts-btn .tts-wave-2 {
  opacity: 0.3;
  transition: opacity 0.2s ease;
}

/* 研报面板（Lite · 新人类） */
.lite-main.is-research-mode .lite-chat-view {
  display: none !important;
}

.lite-main:not(.is-research-mode) .lite-research-panel {
  display: none !important;
}

.lite-chat-view[hidden],
.lite-research-panel[hidden] {
  display: none !important;
}

.lite-chat-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.lite-research-toggle[aria-pressed="true"] {
  background: rgba(99, 102, 241, 0.15);
  color: var(--lite-accent);
}

.lite-research-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem 1.5rem;
  overflow: hidden;
}

.lite-research-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.lite-research-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.lite-research-sub {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: var(--lite-text-dim);
}

.lite-research-close {
  flex-shrink: 0;
  border: 1px solid var(--lite-border);
  background: var(--lite-surface);
  color: var(--lite-text);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.lite-research-close:hover {
  border-color: #3f3f46;
}

.lite-research-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.lite-research-quota {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--lite-text-dim);
}

.lite-research-new {
  border: none;
  background: var(--lite-accent);
  color: #fff;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.lite-research-new:hover {
  background: var(--lite-accent-hover);
}

.lite-research-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lite-research-empty {
  margin: 0;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--lite-text-dim);
  font-size: 0.875rem;
}

.lite-research-card {
  border: 1px solid var(--lite-border);
  background: var(--lite-surface);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}

.lite-research-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.lite-research-serial {
  font-size: 0.75rem;
  color: var(--lite-text-dim);
  font-family: ui-monospace, monospace;
}

.lite-research-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
}

.lite-research-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
}

.lite-research-meta,
.lite-research-sum {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--lite-text-dim);
  line-height: 1.5;
}

.lite-research-sum {
  margin-top: 0.5rem;
}

.lite-research-card-actions {
  margin-top: 0.75rem;
}

.lite-research-dl {
  border: 1px solid var(--lite-border);
  background: transparent;
  color: var(--lite-text);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.lite-research-dl:hover {
  border-color: var(--lite-accent);
  color: var(--lite-accent);
}

.lite-research-modal-panel {
  max-width: 28rem;
}

.lite-research-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.lite-research-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lite-research-fields[hidden] {
  display: none;
}

.lite-research-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--lite-text-dim);
}

.lite-research-input {
  width: 100%;
  border: 1px solid var(--lite-border);
  background: var(--lite-bg);
  color: var(--lite-text);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 0.875rem;
}

.lite-research-textarea {
  resize: vertical;
  min-height: 5rem;
}

.lite-research-input:focus {
  outline: none;
  border-color: var(--lite-accent);
}
