/* BugCapturer · Integrations 设置页样式（v1.3.2：左平台目录 + 右内容面板，依赖 auth.css 基础组件） */
/* 顶栏导航链接样式已上移至 auth.css（与 my-shares 页共用） */

/* ===== 页面框架：左目录 + 右面板 ===== */
.ig-wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 20px 60px;
  flex: 1;
}
.ig-shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

/* —— 左侧平台目录 —— */
.ig-side {
  background: rgba(14, 22, 48, 0.55);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 16px;
  padding: 14px 10px;
  position: sticky;
  top: 84px;
}
.ig-side-head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
  padding: 4px 10px 10px;
}
.ig-side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  font-family: inherit;
  text-align: left;
  background: none;
  border: none;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  color: #b6c3de;
}
.side-item:hover { background: rgba(99, 102, 241, 0.1); color: var(--text, #e2e8f0); }
.side-item.active {
  background: rgba(99, 102, 241, 0.16);
  color: var(--text, #e2e8f0);
}
.side-item.soon { cursor: default; }
.side-item.soon:hover { background: rgba(99, 102, 241, 0.05); }
.side-item.soon .side-name { color: #7c8db0; }

.side-logo {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 800;
  border: 1px solid;
  border-radius: 9px;
}
.side-logo.big { width: 52px; height: 52px; font-size: 20px; border-radius: 14px; }

.side-name {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-count {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.16);
  border-radius: 999px;
  padding: 1px 7px;
}
.side-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}
.side-badge.ok { color: #34d399; background: rgba(52, 211, 153, 0.12); }
.side-badge.soon { color: #64748b; background: rgba(100, 116, 139, 0.16); }

/* —— 右侧内容面板 —— */
.ig-panel {
  min-width: 0;
}
.ig-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.ig-sub {
  color: #8ea0c0;
  font-size: 13.5px;
  margin-top: 4px;
}
.ig-doc-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #a5b4fc;
  text-decoration: none;
  padding: 7px 12px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 9px;
  background: rgba(99, 102, 241, 0.08);
}
.ig-doc-link:hover { background: rgba(99, 102, 241, 0.16); }

/* ===== 集成卡片 ===== */
.ig-list { display: flex; flex-direction: column; gap: 12px; }
.ig-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: rgba(14, 22, 48, 0.6);
  border: 1px solid rgba(99, 102, 241, 0.22);
  border-radius: 14px;
}
.ig-item.disabled { opacity: 0.72; }
.ig-item-main { flex: 1; min-width: 0; }
.ig-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ig-item-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #e2e8f0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.ig-type {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.ig-type.type-a { color: #7dd3fc; background: rgba(125, 211, 252, 0.1); border: 1px solid rgba(125, 211, 252, 0.3); }
.ig-type.type-b { color: #c4b5fd; background: rgba(196, 181, 253, 0.1); border: 1px solid rgba(196, 181, 253, 0.3); }

.ig-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
}
.ig-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.ig-status.active { color: #34d399; background: rgba(52, 211, 153, 0.12); }
.ig-status.paused { color: #fbbf24; background: rgba(251, 191, 36, 0.12); }
.ig-status.disabled { color: #f87171; background: rgba(248, 113, 113, 0.12); }

.ig-item-meta {
  margin-top: 6px;
  font-size: 12px;
  color: #8ea0c0;
  line-height: 1.6;
  word-break: break-all;
}
.ig-item-meta .ok { color: #34d399; }
.ig-item-meta .bad { color: #f87171; }

.ig-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.ig-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: #c7d2fe;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  background: transparent;
  cursor: pointer;
}
.ig-btn:hover { background: rgba(99, 102, 241, 0.14); }
.ig-btn:disabled { opacity: 0.5; cursor: default; }

/* ⋯ 下拉菜单 */
.ig-more-wrap { position: relative; display: inline-flex; }
.ig-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 128px;
  background: #131c3d;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 10px;
  padding: 5px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
}
.ig-menu-item {
  font-size: 12.5px;
  font-family: inherit;
  font-weight: 600;
  text-align: left;
  color: #c7d2fe;
  background: none;
  border: none;
  border-radius: 7px;
  padding: 7px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.ig-menu-item:hover { background: rgba(99, 102, 241, 0.16); }
.ig-menu-item.danger { color: #fca5a5; }
.ig-menu-item.danger:hover { background: rgba(248, 113, 113, 0.12); }

/* 空状态 */
.ig-empty {
  text-align: center;
  padding: 46px 20px;
  border: 1px dashed rgba(99, 102, 241, 0.3);
  border-radius: 14px;
  color: #8ea0c0;
}
.ig-empty .big { font-size: 34px; margin-bottom: 8px; }
.ig-empty h2 { color: var(--text, #e2e8f0); font-size: 16px; margin-bottom: 6px; }
.ig-empty p { font-size: 13px; }

/* 开发中占位 */
.ig-soon {
  text-align: center;
  padding: 52px 20px;
  border: 1px dashed rgba(100, 116, 139, 0.4);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.ig-soon-badge {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.14);
  padding: 3px 12px;
  border-radius: 999px;
}
.ig-soon-desc {
  font-size: 13px;
  color: #8ea0c0;
  max-width: 380px;
  line-height: 1.7;
}

.ig-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
}
.ig-quota { font-size: 12.5px; color: #8ea0c0; }

/* ===== 弹层 ===== */
.ig-mask {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(2, 6, 18, 0.72);
  backdrop-filter: blur(4px);
  overflow-y: auto;
}
.ig-mask.open { display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; }

.ig-wizard, .ig-log {
  width: 100%;
  max-width: 560px;
  background: #0e1630;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 16px;
  padding: 22px 24px 24px;
}
.wiz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.wiz-head h2 { font-size: 17px; color: var(--text, #e2e8f0); }
.wiz-close {
  background: none;
  border: none;
  color: #8ea0c0;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}
.wiz-close:hover { color: var(--text, #e2e8f0); }

/* —— 接入方式选择卡片 —— */
.wiz-mode-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wiz-mode {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  font-family: inherit;
  text-align: left;
  background: rgba(5, 10, 24, 0.5);
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 13px;
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.wiz-mode:hover {
  border-color: rgba(99, 102, 241, 0.65);
  background: rgba(99, 102, 241, 0.1);
}
.wm-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10.5px;
  font-weight: 700;
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
  padding: 2px 9px;
  border-radius: 999px;
}
.wm-title { font-size: 14.5px; font-weight: 700; color: var(--text, #e2e8f0); }
.wm-desc { font-size: 12.5px; color: #8ea0c0; line-height: 1.65; padding-right: 64px; }

.wiz-steps {
  margin: 0 0 14px 18px;
  color: #c7d2fe;
  font-size: 13px;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wiz-note {
  font-size: 12.5px;
  color: #8ea0c0;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 9px;
  padding: 9px 12px;
}
.wiz-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.wiz-actions .btn-ghost { margin-right: auto; }
.wiz-body .field { margin-bottom: 12px; }
.f-hint { font-size: 11.5px; color: #64748b; margin-top: 5px; line-height: 1.5; }

/* 保存进度 */
.wiz-progress {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.wp-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: #64748b;
}
.wp-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #334155;
  flex-shrink: 0;
  transition: background 0.2s;
}
.wp-item.running { color: #c7d2fe; }
.wp-item.running .wp-dot { background: #6366f1; animation: wp-pulse 1s infinite; }
.wp-item.done { color: #34d399; }
.wp-item.done .wp-dot { background: #34d399; animation: none; }
.wp-item.fail { color: #f87171; }
.wp-item.fail .wp-dot { background: #f87171; animation: none; }
@keyframes wp-pulse { 50% { opacity: 0.35; } }

/* ===== 投递日志 ===== */
.ig-log-list {
  max-height: 56vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ig-log-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  padding: 9px 12px;
  background: rgba(5, 10, 24, 0.5);
  border: 1px solid rgba(99, 102, 241, 0.16);
  border-radius: 9px;
}
.ig-log-item .lg-icon { flex-shrink: 0; margin-top: 1px; }
.ig-log-item.ok .lg-icon { color: #34d399; }
.ig-log-item.bad .lg-icon { color: #f87171; }
.ig-log-item .lg-main { flex: 1; min-width: 0; }
.ig-log-item .lg-line1 { color: var(--text, #e2e8f0); }
.ig-log-item .lg-line2 { color: #8ea0c0; font-size: 11.5px; margin-top: 2px; word-break: break-all; }
.ig-log-empty { text-align: center; color: #8ea0c0; font-size: 13px; padding: 26px 0; }

/* ===== 确认弹层 ===== */
.ig-dialog {
  width: 100%;
  max-width: 400px;
  background: #0e1630;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 14px;
  padding: 20px 22px;
}
.ig-dialog .msg { font-size: 14px; color: var(--text, #e2e8f0); line-height: 1.6; }
.ig-dialog .row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* toast 样式复用 auth.css（#toast），此处仅保证层级 */
#toast { z-index: 90; }

/* ===== 移动端：目录折叠为横向滑动的平台条 ===== */
@media (max-width: 860px) {
  .ig-wrap { padding: 22px 14px 48px; }
  .topbar { padding: 12px 16px; }
  .topbar-nav { margin-left: 14px; gap: 12px; }
  .ig-shell { grid-template-columns: 1fr; gap: 14px; }
  .ig-side {
    position: static;
    padding: 10px;
  }
  .ig-side-head { display: none; }
  .ig-side-nav {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .side-item {
    width: auto;
    flex-shrink: 0;
    padding: 7px 10px;
  }
  .side-badge { display: none; }
  .ig-head { flex-direction: column; }
  .ig-item { flex-direction: column; }
  .ig-item-actions { align-self: flex-end; }
  .ig-mask.open { padding: 20px 10px; }
  .wm-desc { padding-right: 0; }
}
