/* report-agent-panel.css — 观复报告对话面板样式 (Phase 1) */
/* 设计令牌复用 qa.html: --navy / --gold / --ink / --paper */

/* ── Backdrop ── */
.ragp-backdrop {
  position: fixed; inset: 0; z-index: 99998;
  background: rgba(0,0,0,0);
  transition: background .3s ease;
  pointer-events: none;
}
.ragp-backdrop.ragp-visible {
  background: rgba(0,0,0,0.35);
  pointer-events: auto;
}

/* ── Panel ── */
.ragp-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 99999;
  width: 420px; max-width: 100vw;
  background: #fefefe; color: #2c2c2c;
  display: flex; flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,.12);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  font-family: 'Noto Sans SC','PingFang SC','Microsoft YaHei',system-ui,sans-serif;
}
.ragp-panel.ragp-visible { transform: translateX(0); }

/* ── Header ── */
.ragp-header {
  background: #1a2a3a; color: #fff;
  padding: 14px 20px; display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.ragp-header-title { font-weight: 700; font-size: 16px; letter-spacing: -0.5px; font-family: 'Noto Serif SC',serif; }
.ragp-close {
  margin-left: auto; background: none; border: none; color: rgba(255,255,255,.6);
  font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.ragp-close:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ── Philosopher Bar ── */
.ragp-phil-bar {
  display: flex; gap: 4px; padding: 8px 12px;
  background: #fefefe; border-bottom: 1px solid #e8e2d8;
  flex-shrink: 0; overflow-x: auto;
}
.ragp-phil-btn {
  padding: 6px 10px; font-size: 12px; border: 1px solid #d5cec4;
  border-radius: 16px; background: #f5f0e8; color: #5c5c5c;
  cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 4px;
  font-family: inherit; transition: all .15s;
}
.ragp-phil-btn:hover { border-color: #c04040; color: #c04040; background: rgba(192,64,64,0.06); }
.ragp-phil-btn.active { background: #c04040; color: #fff; border-color: #c04040; }
.ragp-phil-emoji { font-size: 14px; }
.ragp-phil-name { font-size: 11px; font-weight: 500; }

/* ── Messages ── */
.ragp-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 14px;
  scroll-behavior: smooth;
}
.ragp-msg { display: flex; gap: 10px; max-width: 90%; animation: ragpIn .25s ease-out; }
@keyframes ragpIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.ragp-msg-user { align-self: flex-end; flex-direction: row-reverse; }
.ragp-msg-assistant { align-self: flex-start; }

.ragp-msg-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0;
}
.ragp-msg-user .ragp-msg-avatar { background: rgba(192,64,64,0.08); color: #c04040; }
.ragp-msg-assistant .ragp-msg-avatar { background: #1a2a3a; color: #fff; font-size: 12px; }

.ragp-msg-bubble {
  padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.7;
  word-break: break-word;
}
.ragp-msg-user .ragp-msg-bubble {
  background: rgba(192,64,64,0.08); border-bottom-right-radius: 4px;
}
.ragp-msg-assistant .ragp-msg-bubble {
  background: #fefefe; border: 1px solid #e8e2d8;
  border-bottom-left-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.ragp-msg-bubble a { color: #c04040; }
.ragp-msg-bubble strong { color: #2c2c2c; }

/* Typing indicator */
.ragp-typing span { animation: ragpDot 1.4s infinite; }
.ragp-typing span:nth-child(2) { animation-delay: .2s; }
.ragp-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes ragpDot { 0%,60%,100% { opacity: .3; } 30% { opacity: 1; } }

/* ── Input Area ── */
.ragp-input-area {
  flex-shrink: 0; padding: 12px 16px 18px;
  background: #fefefe; border-top: 1px solid #e8e2d8;
}
.ragp-input-row { display: flex; gap: 8px; align-items: flex-end; }
.ragp-input-row textarea {
  flex: 1; padding: 10px 14px; border: 1px solid #d5cec4; border-radius: 12px;
  font-size: 14px; font-family: inherit; background: #f5f0e8; color: #2c2c2c;
  resize: none; min-height: 42px; max-height: 140px; line-height: 1.5;
}
.ragp-input-row textarea:focus { outline: 2px solid #c04040; outline-offset: -1px; border-color: transparent; }

.ragp-send {
  padding: 10px 18px; border: none; border-radius: 12px;
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
  background: #c04040; color: #fff; transition: all .15s; white-space: nowrap;
}
.ragp-send:hover { background: #a03030; }
.ragp-send:disabled { opacity: .4; cursor: not-allowed; }

/* ── Hint buttons ── */
.ragp-hints { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.ragp-hint-btn {
  padding: 4px 12px; font-size: 12px; border: 1px solid #d5cec4;
  border-radius: 14px; background: #f5f0e8; color: #5c5c5c;
  cursor: pointer; font-family: inherit; transition: all .15s;
}
.ragp-hint-btn:hover { border-color: #c04040; color: #c04040; }

/* ── 暗色模式 ── */
@media (prefers-color-scheme: dark) {
  .ragp-panel { background: #1c1917; color: #e8e2d8; }
  .ragp-header { background: #c04040; }
  .ragp-phil-bar { background: #1c1917; border-color: #383330; }
  .ragp-phil-btn { background: #24201c; border-color: #44403c; color: #b0a898; }
  .ragp-msg-assistant .ragp-msg-bubble { background: #24201c; border-color: #383330; }
  .ragp-msg-user .ragp-msg-bubble { background: rgba(192,64,64,0.12); }
  .ragp-input-area { background: #1c1917; border-color: #383330; }
  .ragp-input-row textarea { background: #24201c; border-color: #44403c; color: #e8e2d8; }
  .ragp-hint-btn { background: #24201c; border-color: #44403c; color: #b0a898; }
  .ragp-msg-bubble strong { color: #e8e2d8; }
}

/* ── 移动端: 全屏底部 Sheet ── */
@media (max-width: 768px) {
  .ragp-panel {
    top: auto; right: 0; bottom: 0; left: 0;
    width: 100%; height: 60vh; max-height: 80vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }
  .ragp-panel.ragp-visible { transform: translateY(0); }
}
