/* ========================================= */
/* 文件：protocol.css                         */
/* 功能：底部通讯协议面板                      */
/*       ——AI 核心切换弹窗（烬城线/阿斯翠亚/   */
/*       临空线）、状态光点呼吸动画、           */
/*       反代线路药丸菜单与模型管理              */
/* ========================================= */


/* =========================================
   ✨ AI 模型核心切换弹窗 (修复版：状态过渡) ✨
   ========================================= */

#ai-core-modal {
  display: flex; /* 永远保持 flex */
  align-items: center;
  justify-content: center;
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 10000;

  /* 默认隐藏状态 */
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

/* 激活状态：背景出现 */
#ai-core-modal.show {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  visibility: visible;
  opacity: 1;
}

.ai-core-card {
  width: 85%;
  max-width: 320px;
  background: linear-gradient(145deg, rgba(30, 32, 45, 0.9), rgba(15, 16, 25, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  padding: 24px 20px;

  /* 默认状态：缩小且透明 */
  transform: scale(0.95);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 激活状态：卡片弹出 */
#ai-core-modal.show .ai-core-card {
  transform: scale(1);
  opacity: 1;
}

@keyframes corePopIn {
  to { transform: scale(1); opacity: 1; }
}

.core-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.core-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #fff;
}

.core-close {
  font-size: 22px;
  color: rgba(255, 255, 255, 0.4);
  width: 30px;
  height: 30px;
  line-height: 28px;
  text-align: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.2s;
}

.core-close:active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.core-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 默认选项框样式 */
.core-option-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 16px;
  transition: all 0.3s ease;
  cursor: pointer;
}

/* ✨ 选中时的发光高亮状态 (新：清透淡紫色) ✨ */
.core-option-box.active {
  /* 背景：极淡的薰衣草紫透明底 */
  background: rgba(190, 170, 255, 0.12);
  /* 边框：柔和的淡紫色光晕 */
  border: 1px solid rgba(190, 170, 255, 0.5);
  /* 内发光：增加通透感 */
  box-shadow: 0 0 20px rgba(190, 170, 255, 0.15) inset;
}

.core-opt-name {
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.core-opt-tag {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 10px;
  background: linear-gradient(90deg, #7b8fed, #a5b4fc);
  color: #1a1a2e;
  font-weight: 600;
}

.core-opt-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.5;
}

.core-footer {
  margin-top: 24px;
}

/* 底部确认按钮 (绝美琥珀玻璃质感) */
.core-confirm-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;

  /* ✨ 琥珀玻璃核心魔法 ✨ */
  background: rgba(255, 179, 122, 0.15);
  color: #ffb37a;
  border: 1px solid rgba(255, 179, 122, 0.3);
  box-shadow: 0 0 15px rgba(255, 179, 122, 0.1), inset 0 0 15px rgba(255, 179, 122, 0.05);
}

/* 按钮点击态 (光晕增强) */
.core-confirm-btn:active {
  transform: scale(0.98);
  background: rgba(255, 179, 122, 0.25);
  box-shadow: 0 0 25px rgba(255, 179, 122, 0.3);
}

.core-confirm-btn:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(255, 159, 67, 0.3);
}

/* ============ ✨ 新增：科幻状态光点 & 排版修复 ✨ ============ */

/* 强制让 Top 区域左右两端对齐，把标签顶到右上角 */
.core-opt-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%; /* 确保撑满宽度 */
  margin-bottom: 8px;
}

/* 名字和光点横向对齐 */
.core-opt-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

/* 标签强制靠右不被挤压 */
.core-opt-tag {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 10px;
  background: linear-gradient(90deg, #7b8fed, #a5b4fc);
  color: #1a1a2e;
  font-weight: 600;
  flex-shrink: 0; /* 绝对禁止被压缩 */
}

/* 光点基础样式 */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

/* 🟣 亮紫色光点 (主链路) - 带有星空般的稳定微光 */
.status-dot.dot-purple {
  background: #b28cff; /* 清透的亮紫色 */
  box-shadow: 0 0 10px rgba(178, 140, 255, 0.8), 0 0 20px rgba(178, 140, 255, 0.4);
}

/* 🟡 黄色光点 (中继信标) - 带有轻微的呼吸警示感 */
.status-dot.dot-yellow {
  background: #f7b731;
  box-shadow: 0 0 8px rgba(247, 183, 49, 0.6);
  animation: faintBreathing 2s infinite ease-in-out;
}

@keyframes faintBreathing {
  0%, 100% { opacity: 0.8; box-shadow: 0 0 5px rgba(247, 183, 49, 0.4); }
  50% { opacity: 1; box-shadow: 0 0 10px rgba(247, 183, 49, 0.7); }
}

/* =========================================
   ✨ 沈星回专属微光与悬浮药丸菜单样式 ✨
   ========================================= */

/* 专属暗紫微光触发文字 (采用心声卡片配色) */
.core-trigger-text {
  color: #a29bfe !important;
  text-decoration: none; /* 既然有了发光圆点，去掉下划线会更显高级 */
  cursor: pointer;
  display: flex;         /* 使用 Flex 布局让圆点和文字完美对齐 */
  align-items: center;
  gap: 6px;              /* 圆点和文字的间距 */
  margin-top: 4px;
  padding: 2px 0;
  transition: all 0.3s ease;
  user-select: none;
}

/* 基础圆点形状 */
.core-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ✦ 烬城线：暗紫呼吸 */
.glow-purple { background-color: #a29bfe; animation: breathPurple 2s infinite alternate; }
@keyframes breathPurple {
  0% { box-shadow: 0 0 4px rgba(162, 155, 254, 0.4); opacity: 0.7; }
  100% { box-shadow: 0 0 12px rgba(162, 155, 254, 1); opacity: 1; }
}

/* ✦ 阿斯翠亚线：星蓝呼吸 */
.glow-blue { background-color: #88c0ff; animation: breathBlue 2s infinite alternate; }
@keyframes breathBlue {
  0% { box-shadow: 0 0 4px rgba(136, 192, 255, 0.4); opacity: 0.7; }
  100% { box-shadow: 0 0 12px rgba(136, 192, 255, 1); opacity: 1; }
}

/* ✦ 临空线：薄荷绿呼吸 */
.glow-green { background-color: #88ffb0; animation: breathGreen 2s infinite alternate; }
@keyframes breathGreen {
  0% { box-shadow: 0 0 4px rgba(136, 255, 176, 0.4); opacity: 0.7; }
  100% { box-shadow: 0 0 12px rgba(136, 255, 176, 1); opacity: 1; }
}

/* 药丸菜单（常态展开，非浮动） */
.pill-menu-container {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 20px;
  white-space: nowrap;
  overflow-x: auto;
  max-width: 100%;
}
.pill-menu-container::-webkit-scrollbar { display: none; }

@keyframes slideDownPill {
  from { opacity: 0; transform: translateY(-8px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 药丸内的选项 */
.pill-option {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  padding: 5px 10px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.pill-option:active { transform: scale(0.95); }
.pill-option.active {
  background: rgba(162, 155, 254, 0.15); /* 同步暗紫 */
  color: #a29bfe; /* 同步暗紫 */
  border: 1px solid rgba(162, 155, 254, 0.4);
}

/* 状态圆点 (主色调同步暗紫) */
.pill-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dot-purple { background: #a29bfe; box-shadow: 0 0 5px #a29bfe; }
.dot-blue { background: #88c0ff; box-shadow: 0 0 5px #88c0ff; }
.dot-green { background: #88ffb0; box-shadow: 0 0 5px #88ffb0; }
/* --- 以下样式保持不变 --- */
.setting-item-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.setting-item-row.disabled { opacity: 0.5; pointer-events: none; }
.setting-left { display: flex; flex-direction: column; gap: 4px; }
.setting-label { font-size: 15px; color: #fff; font-weight: 500; }
.setting-desc { font-size: 12px; color: rgba(255,255,255,0.5); }

/* 反代区域：横向两列布局 */
#proxy-model-row {
  display: block;
}

.proxy-row-wrap {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  width: 95%;
  margin: 6px auto 20px;
}

/* 左：网站选择器 */
.proxy-site-wrap {
  position: relative;
  flex-shrink: 0;
}

.proxy-site-btn {
  width: auto !important;
  margin: 0 !important;
  padding: 8px 12px !important;
  cursor: pointer;
  gap: 5px;
  white-space: nowrap;
}

.proxy-site-arrow {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  margin-left: 2px;
  transition: transform 0.2s;
  display: inline-block;
}

.proxy-site-menu {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  z-index: 200;
  background: rgba(20, 18, 35, 0.96);
  border: 1px solid rgba(162, 155, 254, 0.3);
  border-radius: 12px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 100%;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}

.proxy-site-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.proxy-site-option {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  padding: 6px 10px;
  border-radius: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background 0.15s;
}
.proxy-site-option:active { background: rgba(255,255,255,0.06); }
.proxy-site-option.active {
  background: rgba(162, 155, 254, 0.15);
  color: #a29bfe;
}

/* 右：模型名称气泡 */
.proxy-model-wrap {
  flex: 1;
  min-width: 0;
  overflow: visible;
}
.proxy-model-wrap .proxy-pill-bar {
  width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box;
}
.proxy-model-wrap #proxy-model-display,
.proxy-model-wrap #proxy-model-picker-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

/* 黄色圆点（给火喵喵用） */
.dot-yellow { background: #f1c40f; box-shadow: 0 0 5px #f1c40f; }

/* 通用模型选择器：撑满父容器宽度 */
.proxy-picker-full { width: 100%; }
.proxy-picker-full .proxy-pill-bar { width: 100% !important; margin: 0 !important; padding: 8px 12px !important; box-sizing: border-box; }

/* 模型菜单内：添加按钮（就地变输入框） */
.proxy-model-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 2px 6px 4px;
  padding: 4px 8px;
  border: 1px solid rgba(162,155,254,0.25);
  border-radius: 8px;
  color: rgba(162,155,254,0.6);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  line-height: 1;
}
.proxy-model-add-btn:active { border-color: rgba(162,155,254,0.6); }
.proxy-model-add-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 11px;
  padding: 0;
  outline: none;
}
.proxy-model-add-ok {
  color: rgba(162,155,254,0.8);
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
  padding: 4px 8px;
}


.proxy-model-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  background: rgba(255, 179, 122, 0.08);
  border: 1px solid rgba(255, 179, 122, 0.2);
  border-radius: 20px;
  padding: 5px 12px;
}

#proxy-model-display {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.proxy-pill-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 90%;
  margin: 0 auto;
  padding: 9px 13px;
  background: rgba(162, 155, 254, 0.08);
  border: 1px solid rgba(162, 155, 254, 0.4);
  box-shadow: 0 0 8px rgba(162, 155, 254, 0.2);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  box-sizing: border-box;
}

.proxy-edit-icon {
  filter: invert(1);
  opacity: 0.6;
  flex-shrink: 0;
}

.proxy-model-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 12px;
  outline: none;
  padding: 0;
  box-sizing: border-box;
}

.proxy-confirm-btn {
  font-size: 16px;
  color: #a29bfe;
  cursor: pointer;
  opacity: 0.9;
  flex-shrink: 0;
  user-select: none;
}
