/* ============================================================
   Agent / MCP 接入页共享样式
   依赖 news-index.css 提供的工作台骨架与 CSS 变量
   ============================================================ */

/* 侧栏中的导航项在接入页使用 <a> 标签渲染 */
.news-workbench-sidebar a.news-sidebar-nav-item { text-decoration: none; }

/* ---------- 页头徽章 ---------- */
.access-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.access-badge {
  display: inline-flex; align-items: center; gap: .38rem;
  border: 1px solid var(--news-line); border-radius: 999px;
  padding: .28rem .75rem; background: #fff;
  color: #526476; font-size: .72rem; font-weight: 650; line-height: 1;
}
.access-badge i { font-size: .7rem; color: #94a3b8; }
.access-badge--green { border-color: #bbf7d0; background: #f0fdf4; color: #047857; }
.access-badge--green i { color: #16a34a; }
.access-badge--blue { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.access-badge--blue i { color: #2563eb; }
.access-badge--amber { border-color: #fde68a; background: #fffbeb; color: #b45309; }
.access-badge--amber i { color: #d97706; }

/* ---------- 文档区域 ---------- */
.access-doc { display: grid; gap: 1.2rem; max-width: 980px; }

.access-section {
  border: 1px solid var(--news-line); border-radius: .75rem;
  background: var(--news-panel); box-shadow: 0 10px 26px rgba(15,23,42,.035);
  overflow: hidden;
}
.access-section-header {
  display: flex; align-items: center; gap: .6rem;
  border-bottom: 1px solid var(--news-line-soft);
  padding: .85rem 1.25rem;
}
.access-section-header > i { width: 1.25rem; flex: 0 0 1.25rem; color: var(--news-accent-blue); font-size: .9rem; text-align: center; }
.access-section-header h2 { margin: 0; color: #1d2b38; font-size: .98rem; font-weight: 800; letter-spacing: .01em; }
.access-section-header .access-section-hint { margin-left: auto; color: var(--news-subtle); font-size: .68rem; font-weight: 500; white-space: nowrap; }
.access-section-body { padding: 1.05rem 1.25rem 1.2rem; }
.access-section-body > :last-child { margin-bottom: 0; }
.access-lead { margin: 0 0 .9rem; color: #526476; font-size: .82rem; line-height: 1.75; }
.access-lead:last-child { margin-bottom: 0; }
.access-lead strong { color: #1e293b; font-weight: 750; }

/* ---------- 端点 / 工具卡片 ---------- */
.access-card-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.access-card { display: flex; flex-direction: column; gap: .55rem; border: 1px solid var(--news-line); border-radius: .65rem; padding: .95rem 1rem .9rem; background: #fff; }
.access-card-title { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.access-card-title strong { color: #1e293b; font-size: .88rem; font-weight: 800; }
.access-card p { margin: 0; color: #64748b; font-size: .76rem; line-height: 1.65; }
.access-card .access-card-code { color: #0f766e; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: .76rem; word-break: break-all; }

.access-method {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 3rem; border-radius: .35rem; padding: .12rem .45rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .66rem; font-weight: 800; letter-spacing: .05em;
}
.access-method--get { background: #f0fdf4; color: #047857; border: 1px solid #bbf7d0; }
.access-method--post { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ---------- 代码块 ---------- */
.access-code { border: 1px solid var(--news-line); border-radius: .65rem; overflow: hidden; background: #f8fafc; }
.access-code + .access-code { margin-top: .75rem; }
.access-code-header {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  border-bottom: 1px solid var(--news-line-soft); background: #f1f5f9;
  padding: .45rem .5rem .45rem .85rem;
}
.access-code-title { display: inline-flex; align-items: center; gap: .45rem; color: #526476; font-size: .72rem; font-weight: 700; }
.access-code-title i { color: #94a3b8; font-size: .68rem; }
.access-copy-btn {
  display: inline-flex; align-items: center; gap: .35rem; cursor: pointer;
  border: 1px solid var(--news-line); border-radius: .45rem;
  padding: .3rem .65rem; background: #fff; color: #64748b;
  font-size: .68rem; font-weight: 650; line-height: 1;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.access-copy-btn:hover { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.access-copy-btn.is-copied { border-color: #bbf7d0; background: #f0fdf4; color: #047857; }
.access-copy-btn i { font-size: .68rem; }
.access-code pre { margin: 0; padding: .85rem 1rem; overflow-x: auto; color: #1e293b; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: .76rem; line-height: 1.7; scrollbar-width: thin; }
.access-code pre code { font: inherit; white-space: pre; }
.access-code .access-comment { color: #94a3b8; }

/* ---------- 行内代码 ---------- */
.access-doc code:not(pre code),
.access-table code {
  border: 1px solid var(--news-line-soft); border-radius: .35rem; background: #f1f5f9;
  padding: .06rem .35rem; color: #0f766e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .92em; word-break: break-all;
}

/* ---------- 参数 / 字段表格 ---------- */
.access-table-wrap { overflow-x: auto; border: 1px solid var(--news-line-soft); border-radius: .6rem; }
.access-table { width: 100%; border-collapse: collapse; font-size: .76rem; }
.access-table th {
  border-bottom: 1px solid var(--news-line); background: #f8fafc;
  padding: .55rem .8rem; color: #526476; font-weight: 750; text-align: left; white-space: nowrap;
}
.access-table td { border-bottom: 1px solid var(--news-line-soft); padding: .55rem .8rem; color: #526476; line-height: 1.6; vertical-align: top; }
.access-table tbody tr:last-child td { border-bottom: 0; }
.access-table td:first-child { color: #1e293b; font-weight: 650; white-space: nowrap; }
.access-req { color: #b91c1c; font-weight: 800; }
.access-opt { color: #94a3b8; font-weight: 600; }

/* ---------- 提示框 ---------- */
.access-callout {
  display: flex; gap: .65rem; border: 1px solid #bfdbfe; border-radius: .65rem;
  padding: .8rem .95rem; background: #eff6ff; color: #1e40af;
  font-size: .76rem; line-height: 1.75;
}
.access-callout > i { flex: 0 0 auto; margin-top: .14rem; font-size: .85rem; }
.access-callout strong { font-weight: 750; }
.access-callout--warn { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.access-callout--plain { border-color: var(--news-line); background: #f8fafc; color: #526476; }
.access-callout + .access-callout { margin-top: .65rem; }

/* ---------- 示例提问 ---------- */
.access-questions { display: grid; gap: .55rem; padding: 0; margin: 0; list-style: none; counter-reset: access-question; }
.access-questions li {
  display: flex; align-items: center; gap: .65rem;
  border: 1px solid var(--news-line-soft); border-radius: .5rem;
  padding: .6rem .8rem; background: #fff; color: #334155; font-size: .78rem; line-height: 1.65;
  counter-increment: access-question;
}
.access-questions li::before {
  content: counter(access-question);
  display: inline-flex; flex: 0 0 1.4rem; height: 1.4rem; align-items: center; justify-content: center;
  border-radius: .4rem; background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8;
  font-size: .68rem; font-weight: 800; font-variant-numeric: tabular-nums;
}

/* ---------- 步骤 ---------- */
.access-steps { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; counter-reset: access-step; }
.access-steps > li { display: flex; gap: .75rem; counter-increment: access-step; min-width: 0; }
.access-step-no {
  display: inline-flex; flex: 0 0 1.55rem; height: 1.55rem; align-items: center; justify-content: center;
  border-radius: .45rem; background: #eff6ff; border: 1px solid #bfdbfe;
  color: #1d4ed8; font-size: .7rem; font-weight: 800; font-variant-numeric: tabular-nums;
}
.access-steps > li > div { min-width: 0; flex: 1; }
.access-steps > li strong { display: block; color: #1e293b; font-size: .8rem; font-weight: 750; margin-bottom: .2rem; }
.access-steps > li p { margin: 0; color: #64748b; font-size: .75rem; line-height: 1.7; }

/* ---------- 成功的样子 ---------- */
.access-success {
  display: flex; gap: .6rem; border: 1px dashed #bbf7d0; border-radius: .6rem;
  padding: .7rem .85rem; background: #f0fdf4; color: #166534; font-size: .75rem; line-height: 1.7;
}
.access-success > i { flex: 0 0 auto; margin-top: .16rem; color: #16a34a; font-size: .8rem; }

/* ---------- 常见问题 ---------- */
.access-faq { display: grid; gap: .65rem; }
.access-faq-item { border: 1px solid var(--news-line-soft); border-radius: .6rem; padding: .8rem .95rem; background: #fff; }
.access-faq-item h3 { display: flex; align-items: flex-start; gap: .5rem; margin: 0 0 .35rem; color: #1e293b; font-size: .8rem; font-weight: 750; line-height: 1.6; }
.access-faq-item h3 i { flex: 0 0 auto; margin-top: .22rem; color: var(--news-accent-blue); font-size: .72rem; }
.access-faq-item p { margin: 0; color: #64748b; font-size: .76rem; line-height: 1.75; }
.access-faq-item p code { font-size: .92em; }

/* ---------- 底部导航（两个接入页互跳） ---------- */
.access-cross-links { display: flex; flex-wrap: wrap; gap: .75rem; }
.access-cross-link {
  display: inline-flex; align-items: center; gap: .5rem;
  border: 1px solid var(--news-line); border-radius: .6rem; padding: .7rem 1rem;
  background: #fff; color: #334155; font-size: .78rem; font-weight: 700; text-decoration: none;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.access-cross-link i { color: var(--news-accent-blue); }
.access-cross-link:hover { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.access-cross-link span { color: #94a3b8; font-weight: 500; font-size: .68rem; }

/* ---------- 响应式 ---------- */
@media (max-width: 639px) {
  .access-section-header { padding: .75rem 1rem; }
  .access-section-body { padding: .9rem 1rem 1rem; }
  .access-code pre { font-size: .7rem; padding: .7rem .8rem; }
  .access-card-grid { grid-template-columns: 1fr; }
  .access-table { font-size: .72rem; }
  .access-table th, .access-table td { padding: .45rem .6rem; }
  .access-table td:first-child { white-space: normal; }
}
