/* ============================================================
   AioKK · 在线测试台（复用 site.css 设计 token：深底 + 金属金）
   布局：左 360px 配置栏（密钥 / 模型 / 参数）+ 右侧对话区
   ============================================================ */

.pg-main { padding-bottom: 40px; }

/* ---------- 页头 ---------- */
.pg-head { padding: 72px 24px 40px; }
.pg-eyebrow {
  color: var(--gold-2);
  letter-spacing: 0.42em;
  font-size: 13px;
  margin-bottom: 18px;
}
.pg-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.pg-sub { max-width: 640px; margin-top: 18px; color: var(--muted); font-size: 16px; }

/* ---------- 布局 ---------- */
.pg-body {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: start;
  padding-top: 8px;
}

/* ---------- 配置栏面板 ---------- */
.pg-config { display: flex; flex-direction: column; gap: 16px; }
.pg-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
}
.pg-panel-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--gold-2);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pg-count {
  font-size: 11px;
  color: var(--gold-1);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 8px;
  letter-spacing: 0.05em;
}

/* ---------- 输入与按钮 ---------- */
.pg-keyrow { display: flex; align-items: center; gap: 8px; }
.pg-input {
  flex: 1;
  min-width: 0;
  background: #0b0d12;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-family: Consolas, "JetBrains Mono", monospace;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s;
}
.pg-input:focus { border-color: var(--line-strong); }
.pg-input::placeholder { color: #55524a; }
.pg-eye {
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 38px;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  flex: none;
}
.pg-eye:hover { border-color: var(--line-strong); color: var(--gold-1); }

.pg-hint { color: var(--muted); font-size: 12.5px; margin-top: 10px; line-height: 1.6; }
.pg-hint a { color: var(--gold-1); text-decoration: none; }
.pg-hint a:hover { text-decoration: underline; }

.pg-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.pg-row.between { justify-content: space-between; }
.pg-label { font-size: 13px; color: var(--muted); letter-spacing: 0.06em; flex: none; }
.pg-code {
  font-family: Consolas, "JetBrains Mono", monospace;
  font-size: 12.5px;
  color: var(--gold-1);
  background: #0b0d12;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px 10px;
}

.pg-actions { display: flex; gap: 10px; margin-top: 16px; }
.pg-btn { padding: 9px 18px; font-size: 14px; flex: 1; }
.pg-btn-sm { padding: 7px 14px; font-size: 13px; }

.pg-status {
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.6;
  min-height: 0;
  color: var(--muted);
}
.pg-status.ok { color: var(--gold-1); }
.pg-status.err { color: #e08585; }

/* ---------- 模型列表 ---------- */
.pg-models {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.pg-models::-webkit-scrollbar { display: none; }
.pg-empty { color: var(--muted); font-size: 13px; line-height: 1.7; }
.pg-model {
  display: block;
  width: 100%;
  text-align: left;
  background: #0b0d12;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}
.pg-model:hover { border-color: var(--line-strong); }
.pg-model.active {
  border-color: var(--line-strong);
  background: linear-gradient(135deg, rgba(201, 162, 94, 0.10), rgba(201, 162, 94, 0.03));
}
.pg-model-top { display: flex; align-items: baseline; gap: 8px; }
.pg-model-alias { font-weight: 600; font-size: 14.5px; }
.pg-model.active .pg-model-alias { color: var(--gold-1); }
.pg-model-name { color: var(--muted); font-size: 12.5px; flex: 1; }
.pg-model-meta { display: flex; gap: 10px; margin-top: 7px; flex-wrap: wrap; }
.pg-model-meta span { font-size: 11.5px; color: var(--muted); letter-spacing: 0.04em; }
.pg-model-meta b { color: var(--text); font-weight: 500; }
.caps { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.cap {
  font-size: 11px;
  color: var(--gold-1);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 8px;
}

/* ---------- 参数控件 ---------- */
.pg-seg {
  display: flex;
  background: #0b0d12;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  flex: 1;
  max-width: 200px;
}
.pg-seg-btn {
  flex: 1;
  background: none;
  border: none;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  padding: 6px 10px;
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: color 0.2s, background 0.2s;
}
.pg-seg-btn.active { background: var(--gold-grad); color: #17130a; font-weight: 600; }

.pg-slider { margin-top: 16px; }
.pg-slider-head { display: flex; justify-content: space-between; margin-bottom: 8px; }
.pg-val {
  font-family: Consolas, "JetBrains Mono", monospace;
  font-size: 12.5px;
  color: var(--gold-1);
}
.pg-slider input[type="range"] {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-2), rgba(201, 162, 94, 0.25));
  outline: none;
}
.pg-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--gold-1);
  border: 2px solid #17130a;
  cursor: pointer;
}
.pg-slider input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--gold-1);
  border: 2px solid #17130a;
  cursor: pointer;
}

.pg-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.pg-check input { accent-color: var(--gold-2); }

/* ---------- 自定义端点 ---------- */
.pg-custom { margin-top: 12px; }
.pg-custom.hidden { display: none; }

/* ---------- 对话区 ---------- */
.pg-chat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 640px;
  height: calc(100vh - 120px);
  max-height: 900px;
  overflow: hidden;
}
.pg-chat-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}
.pg-chat-model { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.pg-chat-alias {
  font-size: 16px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pg-chat-stats { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.pg-stat-chip {
  font-size: 11.5px;
  font-family: Consolas, "JetBrains Mono", monospace;
  color: var(--gold-1);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.pg-stat-chip.dim { color: var(--muted); }

.pg-messages {
  flex: 1;
  overflow-y: auto;
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.pg-messages::-webkit-scrollbar { display: none; }

/* ---------- 欢迎态 ---------- */
.pg-welcome { text-align: center; margin: auto; max-width: 460px; padding: 20px 0; }
.pg-welcome-title {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--gold-1);
  margin-bottom: 12px;
}
.pg-welcome-sub { color: var(--muted); font-size: 14px; line-height: 1.8; }
.pg-presets { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.pg-preset {
  background: #0b0d12;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  padding: 9px 16px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.pg-preset:hover { border-color: var(--line-strong); color: var(--gold-1); }

/* ---------- 消息气泡 ---------- */
.pg-msg { display: flex; gap: 12px; max-width: 860px; }
.pg-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.pg-avatar {
  width: 32px; height: 32px; min-width: 32px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-family: var(--font-display);
}
.pg-msg.user .pg-avatar {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--muted);
}
.pg-msg.assistant .pg-avatar {
  background: var(--gold-grad);
  color: #17130a;
  font-weight: 700;
}
.pg-bubble {
  background: #0b0d12;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 12.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  min-width: 0;
}
.pg-msg.user .pg-bubble {
  background: linear-gradient(135deg, rgba(201, 162, 94, 0.12), rgba(201, 162, 94, 0.05));
  border-color: var(--line-strong);
}
.pg-reasoning {
  margin-bottom: 10px;
  padding: 10px 14px;
  border-left: 2px solid var(--gold-3);
  background: rgba(201, 162, 94, 0.05);
  border-radius: 0 8px 8px 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  max-height: 160px;
  overflow-y: auto;
}
.pg-reasoning-label {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--gold-2);
  margin-bottom: 6px;
}
.pg-bubble.err {
  border-color: rgba(224, 133, 133, 0.5);
  color: #e0a5a5;
}
.pg-bubble pre {
  background: #08090c;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: Consolas, "JetBrains Mono", monospace;
  font-size: 12.5px;
  line-height: 1.6;
  margin: 8px 0;
}

/* 打字光标（流式中） */
.pg-caret {
  display: inline-block;
  width: 8px; height: 15px;
  background: var(--gold-1);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: pg-blink 0.9s steps(2) infinite;
}
@keyframes pg-blink { 50% { opacity: 0; } }

/* 流式中：禁用发送、按钮变停止 */
.pg-send.stop {
  background: rgba(224, 133, 133, 0.16);
  border: 1px solid rgba(224, 133, 133, 0.5);
  color: #e0a5a5;
  box-shadow: none;
}

/* ---------- 输入区 ---------- */
.pg-composer { border-top: 1px solid var(--line); padding: 14px 22px 16px; }
.pg-textarea {
  width: 100%;
  resize: none;
  background: #0b0d12;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.6;
  outline: none;
  transition: border-color 0.2s;
}
.pg-textarea:focus { border-color: var(--line-strong); }
.pg-textarea::placeholder { color: #55524a; }
.pg-composer-foot { display: flex; align-items: center; margin-top: 10px; }
.pg-composer-foot .pg-hint { margin: 0 auto 0 0; }
.pg-send { flex: none; padding: 10px 30px; }
.pg-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .pg-body { grid-template-columns: 1fr; }
  .pg-chat { height: auto; min-height: 480px; }
  .pg-messages { min-height: 320px; }
  .pg-head { padding: 48px 24px 24px; }
}
