/* 南小怪 IP 智能体页面样式 —— 蓝色科技风 */
.agent-page { min-height: 100vh; display: flex; flex-direction: column; }
.agent-wrap {
  flex: 1;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  max-width: 1100px;
  width: 100%;
  margin: 26px auto;
  padding: 0 16px;
  align-items: stretch;
}

/* ---- 数字人舞台 ---- */
.stage { display: flex; flex-direction: column; gap: 14px; }
.stage-frame {
  position: relative;
  background:
    radial-gradient(420px 300px at 50% 20%, rgba(74,158,255,.30), transparent 70%),
    radial-gradient(360px 260px at 30% 85%, rgba(85,232,255,.18), transparent 65%),
    linear-gradient(165deg, rgba(46, 78, 124, .9), rgba(28, 52, 88, .95));
  border: 1px solid rgba(186,216,255,.3);
  border-radius: 16px;
  min-height: 420px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 12px 40px rgba(16,34,64,.42);
}
/* 舞台网格纹理 */
.stage-frame::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(148,184,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,184,255,.06) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 25%, transparent 75%);
  animation: grid-drift 24s linear infinite;
}
@keyframes grid-drift { from { background-position: 0 0, 0 0; } to { background-position: 36px 72px, 72px 36px; } }
#mascot {
  width: 78%;
  max-width: 320px;
  position: relative;
  animation: idle-float 3.6s ease-in-out infinite;
  filter: drop-shadow(0 14px 26px rgba(47,125,255,.45));
  user-select: none;
  z-index: 1;
}
.stage-frame.speaking #mascot { animation: talk-bounce .5s ease-in-out infinite; }
.stage-frame.speaking #halo { opacity: 1; }
.halo {
  position: absolute; width: 340px; height: 340px; border-radius: 50%;
  border: 2px solid rgba(55,224,255,.45);
  box-shadow: 0 0 46px rgba(47,125,255,.4), inset 0 0 34px rgba(55,224,255,.18);
  opacity: 0; transition: opacity .3s;
  animation: halo-pulse 1.1s ease-in-out infinite;
  z-index: 0;
}
@keyframes idle-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes talk-bounce { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-6px) scale(1.03); } }
@keyframes halo-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

.subtitle-bar {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--panel); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-left: 3px solid var(--primary);
  border-radius: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.7;
  color: #d7e5ff;
  min-height: 66px; max-height: 150px; overflow-y: auto;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.sub-tag {
  flex-shrink: 0; color: #04101f; font-weight: bold;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  font-size: 12px; border-radius: 4px; padding: 2px 8px; margin-top: 2px;
  box-shadow: 0 0 10px rgba(55,224,255,.35);
}
.stage-ctrl { display: flex; gap: 10px; }
.ctrl-btn {
  height: 38px; border: 1px solid var(--line); background: var(--panel);
  border-radius: 20px; padding: 0 16px; font-size: 13px; color: var(--text);
  transition: all .15s;
}
.ctrl-btn:hover { border-color: rgba(47,125,255,.5); }
.ctrl-btn.on { color: var(--primary-2); border-color: rgba(55,224,255,.5); box-shadow: 0 0 10px rgba(55,224,255,.2); }
#agentModel { flex: 1; }
#agentModel option { background: #1d3a63; }

/* ---- 人设卡 ---- */
.agent-chat { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.persona-card {
  background: var(--panel); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 12px; padding: 15px 17px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.pc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pc-head b { color: #eaf3ff; font-size: 16px; letter-spacing: 1px; }
.pc-badge {
  background: linear-gradient(135deg, var(--primary), #6a5cff);
  color: #fff; font-size: 12px; border-radius: 10px; padding: 3px 11px;
  box-shadow: 0 0 12px rgba(47,125,255,.4);
}
.pc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-size: 12.5px; color: #b9cbec; }
.pc-grid > div { line-height: 1.6; }
.pc-grid label { display: block; font-size: 11px; color: var(--primary-2); font-weight: bold; margin-bottom: 1px; }

/* ---- 对话面板 ---- */
.chat-panel {
  flex: 1; display: flex; flex-direction: column;
  background: var(--panel); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-height: 380px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; background: rgba(26, 48, 82, .5); display: flex; flex-direction: column; gap: 10px; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px 0; }
.chat-chips a {
  font-size: 12px; color: var(--primary-2);
  border: 1px solid rgba(55,224,255,.35); background: rgba(47,125,255,.08);
  border-radius: 14px; padding: 4px 12px; cursor: pointer; transition: all .15s;
}
.chat-chips a:hover { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border-color: transparent; box-shadow: 0 0 12px rgba(47,125,255,.4); }
.chat-input { border-top: 1px solid var(--line); padding: 10px 14px 12px; display: flex; gap: 8px; }
.chat-input textarea {
  flex: 1; border: 1px solid var(--line); border-radius: 8px; resize: none; padding: 8px 10px;
  font-size: 14px; font-family: inherit; outline: none;
  background: rgba(34,60,100,.8); color: var(--text); transition: border-color .2s, box-shadow .2s;
}
.chat-input textarea::placeholder { color: #6a82a6; }
.chat-input textarea:focus { border-color: var(--primary); box-shadow: var(--glow); }
.chat-input button {
  width: 84px; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border: none; border-radius: 8px; font-size: 15px;
  box-shadow: 0 0 12px rgba(47,125,255,.25); transition: filter .2s;
}
.chat-input button:hover { filter: brightness(1.15); }
.chat-input button:disabled { opacity: .55; }

.agent-footer { margin-top: 24px; }

@media (max-width: 900px) {
  .agent-wrap { grid-template-columns: 1fr; }
  .stage-frame { min-height: 300px; }
  #mascot { max-width: 220px; }
  .halo { width: 240px; height: 240px; }
}
