/* ========================================
   提建议聊天式模态框（比赛页 + /home/ 壳内 matches tab 共用）
   遮罩容器类名含 overlay，与 SPA 壳提取约定一致
   ======================================== */

.suggestion-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.45);
}

.suggestion-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 28rem;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  max-height: 78vh;
}

.suggestion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  color: var(--text-primary, #1f2937);
}

.suggestion-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.suggestion-close {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0 4px;
  font-size: 22px;
  line-height: 1;
}

.suggestion-close:hover {
  color: #4b5563;
}

.suggestion-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  min-height: 260px;
  max-height: 52vh;
  background: var(--toolbar-bg, #f9fafb);
}

.s-msg {
  max-width: 82%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 10px;
  word-break: break-all;
  white-space: pre-wrap;
}

.s-msg.sys {
  background: #eef2ff;
  color: #4338ca;
  margin-left: 0;
  margin-right: auto;
  border-bottom-left-radius: 4px;
  font-size: 13px;
}

.s-msg.me {
  background: linear-gradient(90deg, #3b82f6, #9333ea);
  color: #ffffff;
  margin-left: auto;
  margin-right: 0;
  border-bottom-right-radius: 4px;
}

.s-msg.admin {
  background: #ecfdf5;
  color: #047857;
  margin-left: 0;
  margin-right: auto;
  border-bottom-left-radius: 4px;
}

.s-msg-time {
  display: block;
  font-size: 11px;
  opacity: 0.75;
  margin-top: 3px;
}

.suggestion-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--card-bg, #ffffff);
  border-top: 1px solid var(--border-color, #e5e7eb);
}

.suggestion-input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  outline: none;
  background: var(--card-bg, #ffffff);
  color: var(--text-primary, #1f2937);
  min-width: 0;
}

.suggestion-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.suggestion-send {
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 14px;
  cursor: pointer;
  background: linear-gradient(90deg, #3b82f6, #9333ea);
  color: #ffffff;
  flex-shrink: 0;
}

.suggestion-send:hover {
  opacity: 0.88;
}

.suggestion-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== 暗黑模式 ===== */
body.dark-mode .suggestion-panel {
  background: #1e1e1e;
  border-color: #374151;
}

body.dark-mode .suggestion-header {
  border-bottom-color: #374151;
  color: #e0e0e0;
}

body.dark-mode .suggestion-close {
  color: #6b7280;
}

body.dark-mode .suggestion-messages {
  background: #121212;
}

body.dark-mode .s-msg.sys {
  background: #312e81;
  color: #c7d2fe;
}

body.dark-mode .s-msg.admin {
  background: #064e3b;
  color: #a7f3d0;
}

body.dark-mode .suggestion-input-area {
  background: #1e1e1e;
  border-top-color: #374151;
}

body.dark-mode .suggestion-input {
  background: #111827;
  border-color: #374151;
  color: #e0e0e0;
}
