/* 机器人面板入口 —— 沿用站点樱花粉 + 毛玻璃风格 */

/* ---------- 标签按钮 ---------- */

/* 注入的标签会复制 Vue 的 data-v-xxx（.has-scope），从而直接套用站点
   `.tabs button` 的原生样式；下面仅在拿不到原生样式时兜底。 */
.bot-panel-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.bot-panel-tab svg { flex: 0 0 auto; }

.bot-panel-tab:not(.has-scope) {
  padding: 8px 14px;
  border: 1.5px solid var(--glass-border, rgba(255, 182, 210, .45));
  border-radius: 999px;
  background: rgba(255, 255, 255, .55);
  color: var(--ink-soft, inherit);
  font-size: .85rem;
  cursor: pointer;
  transition: all var(--transition-fast, .2s ease);
}
.bot-panel-tab:not(.has-scope):hover {
  border-color: var(--pink-mid, #ff9ec4);
  color: var(--pink-deep, #d76791);
}
.bot-panel-tab:not(.has-scope).active {
  background: var(--grad-primary, linear-gradient(135deg, #ff9ec4, #ff7aa8));
  color: #fff;
  border-color: transparent;
  font-weight: 600;
}

/* ---------- 切换机制 ---------- */

/* 博客后台是 Vue 的 tab + v-if 结构，外部按钮改不了它的状态，
   所以激活时给 .admin-page 挂模式类，隐藏页头以外的所有内容区。
   与「服务器状态」模块的 .admin-monitor-mode 同款机制、互斥切换。 */
.admin-page.bot-panel-mode > :not(.admin-header):not(#bot-panel-gateway) {
  display: none !important;
}

#bot-panel-gateway { margin-top: 18px; }
#bot-panel-gateway[hidden] { display: none !important; }

/* ---------- 面板内容 ---------- */

.bot-panel-wrap {
  padding: 22px;
  border-radius: var(--radius-lg, 16px);
  background: var(--glass-bg, rgba(255, 255, 255, .72));
  border: 1px solid var(--glass-border, rgba(255, 182, 210, .45));
  box-shadow: var(--shadow, 0 6px 20px rgba(255, 150, 190, .12));
  backdrop-filter: blur(10px);
}

.bot-panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}
.bot-panel-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 17px;
  color: var(--pink-text, #c2185b);
}
.bot-panel-head p { margin: 0; font-size: 13px; opacity: .72; line-height: 1.6; }

.bot-panel-guard {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--pink-text, #c2185b);
  background: var(--pink-light, #ffe6ef);
  white-space: nowrap;
}

.bot-panel-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.bot-panel-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-md, 12px);
  background: rgba(255, 255, 255, .78);
  border: 1px solid var(--glass-border, rgba(255, 182, 210, .4));
}
.bot-panel-card-head { display: flex; gap: 12px; }
.bot-panel-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  color: var(--pink-text, #c2185b);
  background: var(--pink-light, #ffe6ef);
}
.bot-panel-card h3 { margin: 0 0 4px; font-size: 15px; }
.bot-panel-card p { margin: 0; font-size: 12.5px; opacity: .72; line-height: 1.55; }

.bot-panel-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.bot-panel-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; opacity: .8; }
.bot-panel-dot i { width: 7px; height: 7px; border-radius: 50%; background: #c9c9c9; }
.bot-panel-dot.is-up i { background: #3ecf8e; box-shadow: 0 0 0 3px rgba(62, 207, 142, .16); }
.bot-panel-dot.is-down i { background: #ff6b81; box-shadow: 0 0 0 3px rgba(255, 107, 129, .16); }

.bot-panel-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #ff9ec4, #ff7aa8);
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.bot-panel-open:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(255, 122, 168, .35); }
.bot-panel-open:disabled { opacity: .6; cursor: default; }

.bot-panel-hint { margin: 14px 0 0; font-size: 12px; opacity: .6; }

/* ---------- 窄屏 ---------- */

@media (max-width: 640px) {
  .bot-panel-wrap { padding: 16px; }
  .bot-panel-grid { grid-template-columns: 1fr; }
  .bot-panel-guard { display: none; }
}

@media (prefers-color-scheme: dark) {
  .bot-panel-card { background: rgba(30, 30, 38, .8); }
  .bot-panel-tab:not(.has-scope):hover { background: rgba(255, 255, 255, .08); }
}

/* ---------- 群功能开关区块 ---------- */
.bot-feature-block {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--glass-border, rgba(255, 182, 210, .45));
}
.bot-feature-block .bot-panel-head { margin-bottom: 12px; }
.bot-cmd {
  display: inline-block;
  margin: 6px 0 0;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--pink-text, #c2185b);
  background: var(--pink-light, #ffe6ef);
}
.bot-err { color: #d03a52; }

/* ---------- 服务器状态 ---------- */
.srv-rows { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.srv-row { display: grid; grid-template-columns: 88px 1fr 62px 132px; align-items: center; gap: 10px; font-size: 13px; }
.srv-k { color: var(--pink-text, #c2185b); font-weight: 600; }
.srv-v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.srv-d { color: #8a7a85; font-size: 12px; font-variant-numeric: tabular-nums; }
.srv-bar { height: 8px; border-radius: 6px; background: rgba(255, 182, 210, .28); overflow: hidden; }
.srv-bar > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #7ec8e3, #b3e5fc); transition: width .35s ease; }
.srv-bar.is-warn > i { background: linear-gradient(90deg, #ffc857, #ffb347); }
.srv-bar.is-danger > i { background: linear-gradient(90deg, #ff8a80, #ff5252); }
.srv-svcs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.srv-svc { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; background: rgba(255, 255, 255, .7); border: 1px solid rgba(255, 182, 210, .5); }
.srv-svc > i { width: 7px; height: 7px; border-radius: 50%; background: #bbb; }
.srv-svc.is-up > i { background: #4caf50; box-shadow: 0 0 0 3px rgba(76, 175, 80, .18); }
.srv-svc.is-down > i { background: #f44336; box-shadow: 0 0 0 3px rgba(244, 67, 54, .18); }

/* ---------- 下载资源 ---------- */
.stor-list { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.stor-list li { display: grid; grid-template-columns: 1fr 84px 92px; gap: 10px; align-items: center; font-size: 13px; padding: 6px 10px; border-radius: 8px; background: rgba(255, 255, 255, .6); }
.stor-list code { font-family: ui-monospace, monospace; color: #5b4b57; }
.stor-list span { text-align: right; font-variant-numeric: tabular-nums; color: #c2185b; font-weight: 600; }
.stor-list em { text-align: right; font-style: normal; font-size: 12px; color: #8a7a85; }
.stor-actions { display: flex; gap: 10px; margin-top: 8px; }
.stor-log { margin-top: 10px; max-height: 180px; overflow: auto; padding: 10px; border-radius: 8px; background: #2b2027; color: #e8dde4; font-size: 12px; line-height: 1.5; white-space: pre-wrap; }
