/* ============================================================
   AI智能体&应用 列表页
   ============================================================ */

.agents-page {
  background: #f7f8fa;
  border-top: 1px solid transparent;
  padding: 26px 0 56px;
}

/* ---------- 工具条 ---------- */
.ag-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ag-select,
.ag-per {
  position: relative;
  flex: 0 0 auto;
}

.ag-select select,
.ag-per select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 40px;
  padding: 0 34px 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}

.ag-select { width: 150px; }
.ag-select--pub { width: 110px; }
.ag-per { width: 96px; }

.ag-select select:hover,
.ag-per select:hover { border-color: #cfd3dc; }

.ag-select select:focus,
.ag-per select:focus {
  outline: 0;
  border-color: #c9c2ff;
  box-shadow: 0 0 0 3px rgba(109, 92, 246, .1);
}

.ag-chev {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  color: var(--muted-2);
  pointer-events: none;
}

.ag-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  height: 40px;
  padding: 0 40px 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}

.ag-search:focus-within {
  border-color: #c9c2ff;
  box-shadow: 0 0 0 3px rgba(109, 92, 246, .1);
}

.ag-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
}

.ag-search input::placeholder { color: var(--muted-2); }
.ag-search input::-webkit-search-cancel-button { display: none; }

.ag-search .ag-ico {
  position: absolute;
  right: 14px;
  width: 16px;
  height: 16px;
  color: var(--muted-2);
  pointer-events: none;
}

.ag-clear {
  position: absolute;
  right: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: #eceef2;
  color: #7b8494;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.ag-clear:hover { background: #e2e5ea; color: var(--ink); }
.ag-clear[hidden] { display: none; }

/* ---------- 翻页条 ---------- */
.ag-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.ag-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease), color .18s var(--ease);
}

.ag-arrow svg { width: 15px; height: 15px; }

.ag-arrow:hover:not(:disabled) {
  border-color: #cfd3dc;
  background: #fff;
  color: var(--ink);
}

.ag-arrow:disabled {
  color: #c3c8d2;
  cursor: default;
}

.ag-bar .ag-per { margin-left: 4px; }

/* ---------- 网格 ---------- */
.ag-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.ag-card {
  display: flex;
  flex-direction: column;
  padding: 8px 8px 10px;
  border: 1px solid #eceef2;
  border-radius: 12px;
  background: #fff;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}

.ag-card:hover {
  border-color: #e0e3ea;
  box-shadow: 0 14px 30px -20px rgba(16, 21, 31, .45);
  transform: translateY(-2px);
}

.ag-card[hidden] { display: none; }

/* 封面：纯 CSS 绘制，不依赖外链图片 */
.ag-cover {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 7px;
  overflow: hidden;
  background: var(--bg, #eef0f4);
  isolation: isolate;
}

.mo {
  position: absolute;
  display: block;
}

/* 拼贴海报 */
.mo-poster {
  inset: 16% 15% 24%;
  border-radius: 4px;
  background: var(--c);
}

.mo-poster::before,
.mo-poster::after {
  content: "";
  position: absolute;
  border-radius: 4px;
}

.mo-poster::before {
  left: -14%;
  top: -18%;
  width: 66%;
  height: 92%;
  background: var(--a);
  transform: rotate(-7deg);
}

.mo-poster::after {
  right: -16%;
  top: 6%;
  width: 58%;
  height: 78%;
  background: var(--b);
  transform: rotate(8deg);
  mix-blend-mode: multiply;
}

/* 报纸 */
.mo-paper {
  inset: 13% 19%;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .16);
}

.mo-paper::before {
  content: "";
  position: absolute;
  left: 11%;
  right: 11%;
  top: 9%;
  height: 7%;
  border-radius: 1px;
  background: var(--a);
}

.mo-paper::after {
  content: "";
  position: absolute;
  left: 11%;
  right: 11%;
  top: 25%;
  bottom: 10%;
  background: repeating-linear-gradient(180deg, var(--b) 0 1.5px, transparent 1.5px 5.5px);
  opacity: .75;
}

/* 屏幕 */
.mo-screen {
  left: 13%;
  right: 13%;
  top: 19%;
  bottom: 27%;
  border-radius: 5px;
  background: var(--a);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
}

.mo-screen::before {
  content: "";
  position: absolute;
  inset: 11%;
  border-radius: 3px;
  background: var(--b);
}

.mo-screen::after {
  content: "";
  position: absolute;
  left: 40%;
  right: 40%;
  top: 100%;
  height: 13%;
  border-radius: 0 0 2px 2px;
  background: var(--c);
}

/* 手机 */
.mo-phone {
  left: 31%;
  right: 31%;
  top: 12%;
  bottom: 12%;
  border-radius: 11px;
  background: var(--a);
  box-shadow: 0 5px 14px rgba(0, 0, 0, .2);
}

.mo-phone::before {
  content: "";
  position: absolute;
  inset: 6% 9%;
  border-radius: 7px;
  background: var(--b);
}

.mo-phone::after {
  content: "";
  position: absolute;
  left: 37%;
  right: 37%;
  bottom: 2.6%;
  height: 2.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .6);
}

/* 拼图 */
.mo-puzzle {
  left: 50%;
  top: 50%;
  width: 44%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 14%;
  background: var(--a);
}

.mo-puzzle::before {
  content: "";
  position: absolute;
  left: 32%;
  top: -14%;
  width: 36%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--a);
}

.mo-puzzle::after {
  content: "";
  position: absolute;
  left: -14%;
  top: 32%;
  width: 36%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--a);
}

/* 四格 */
.mo-grid {
  inset: 11%;
  border-radius: 3px;
  background:
    conic-gradient(var(--a) 0 25%, var(--b) 0 50%, var(--c) 0 75%, var(--a) 0);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .12);
}

.mo-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 48%, var(--bg) 48% 52%, transparent 52%),
    linear-gradient(180deg, transparent 48%, var(--bg) 48% 52%, transparent 52%);
}

/* 角色 */
.mo-figure {
  left: 50%;
  top: 50%;
  width: 52%;
  aspect-ratio: .82;
  transform: translate(-50%, -50%);
}

.mo-figure::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 58%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--a);
}

.mo-figure::after {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  top: 47%;
  bottom: 0;
  border-radius: 46% 46% 22% 22%;
  background: var(--b);
}

/* 大字海报 */
.mo-type {
  inset: 15% 13%;
  border-radius: 3px;
  background: var(--a);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .2);
}

.mo-type::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 16%;
  height: 40%;
  border-radius: 1px;
  background:
    repeating-linear-gradient(180deg, var(--b) 0 9px, transparent 9px 17px);
}

.mo-type::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 30%;
  bottom: 16%;
  height: 5px;
  border-radius: 1px;
  background: var(--c);
}

/* 空间 */
.mo-room::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg);
}

.mo-room::after {
  content: "";
  position: absolute;
  left: 18%;
  top: 14%;
  width: 64%;
  height: 46%;
  border-radius: 2px;
  background: var(--a);
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .18);
}

.mo-room {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, var(--b) 60%);
}

/* 光效 */
.mo-burst {
  inset: 0;
  background: radial-gradient(circle at 50% 46%, var(--a) 0%, transparent 60%);
}

.mo-burst::after {
  content: "";
  position: absolute;
  left: 40%;
  top: 12%;
  width: 26%;
  height: 76%;
  background: var(--b);
  clip-path: polygon(56% 0, 26% 52%, 46% 52%, 38% 100%, 74% 44%, 52% 44%);
}

/* ---------- 卡片文字 ---------- */
.ag-name {
  margin: 11px 2px 9px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ag-btn {
  display: block;
  margin-top: auto;
  padding: 9px 0;
  border-radius: 8px;
  background: #17181c;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  transition: background .18s var(--ease);
}

.ag-btn:hover { background: #000; }

/* 未发布：按钮置灰不可点 */
.ag-btn.is-off {
  background: #e7e9ee;
  color: #9aa0ab;
  cursor: default;
}

/* 未发布角标：暖橙提示 */
.ag-tag--off {
  background: rgba(196, 106, 34, .82);
}

.ag-empty {
  margin: 60px 0 20px;
  text-align: center;
  font-size: 14px;
  color: var(--muted-2);
}

/* ---------- 分页 ---------- */
.agents-page .pager {
  margin-top: 34px;
  justify-content: center;
}

.agents-page .pager[hidden] { display: none; }

/* ============================================================
   真实数据（Coze 智能体 / 应用）
   ============================================================ */

/* 封面：真实图标铺满，底色兜底 */
.ag-cover {
  background: linear-gradient(150deg, #eef0f4, #e4e8ef);
}

.ag-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 应用角标（智能体不加，保持干净） */
.ag-tag {
  position: absolute;
  left: 6px;
  top: 6px;
  z-index: 2;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(16, 18, 24, .58);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .02em;
}

/* 数据统计（“已发布 7 个智能体 · 6 个应用”） */
.ag-stats {
  flex: 0 0 auto;
  padding-left: 2px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted-2);
  white-space: nowrap;
}

.ag-stats[hidden] { display: none; }

/* 骨架屏 */
.ag-card.is-loading { pointer-events: none; }

.ag-card.is-loading .ag-cover,
.ag-card.is-loading .ag-line {
  background: linear-gradient(100deg, #eceef2 30%, #f6f7f9 50%, #eceef2 70%);
  background-size: 240% 100%;
  animation: agShimmer 1.25s ease-in-out infinite;
}

.ag-line {
  height: 12px;
  margin: 12px 2px 0;
  border-radius: 4px;
}

.ag-line--btn {
  height: 31px;
  margin-top: 10px;
  border-radius: 8px;
}

@keyframes agShimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ag-card.is-loading .ag-cover,
  .ag-card.is-loading .ag-line { animation: none; }
}

/* 分页按钮化后的细节 */
.agents-page .pager button {
  font-family: inherit;
  cursor: pointer;
}

.agents-page .pager button:disabled {
  color: #c9ced8;
  background: #fbfbfc;
  cursor: default;
}

.pager-gap {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 36px;
  font-size: 13px;
  color: var(--muted-2);
}

/* ---------- 数字页码（两个箭头中间） ---------- */
.ag-pager {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 4px;
}

.ag-pager[hidden] { display: none; }

.ag-pager .pager-num {
  min-width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
}

.ag-pager .pager-num.is-active {
  background: #14181f;
  border-color: #14181f;
}

.ag-grid[hidden] { display: none; }

@media (max-width: 560px) {
  .ag-stats {
    order: 4;
    flex-basis: 100%;
    white-space: normal;
  }
}


/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
  .ag-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .ag-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .ag-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}

@media (max-width: 560px) {
  .agents-page { padding-top: 18px; }
  .ag-toolbar { flex-wrap: wrap; }
  .ag-select { width: 124px; }
  .ag-search { flex-basis: 100%; }
  .ag-card { padding: 6px 6px 8px; }
  .ag-name { font-size: 12.5px; margin: 9px 2px 7px; }
  .ag-btn { padding: 8px 0; font-size: 12px; }
}

/* ---------- 紧凑 Hero（内页复用首页大头图） ---------- */
.hero--compact .hero-inner { padding-top: 44px; padding-bottom: 48px; }
.hero--compact .hero-title { font-size: clamp(23px, 2.5vw, 33px); max-width: 26em; }
.hero--compact .hero-sub { margin-top: 13px; font-size: 13px; }
.hero--compact .hero-cta { margin-top: 20px; padding: 8px 16px; gap: 9px; }
.hero--compact .cta-text,
.hero--compact .cta-link { font-size: 12.5px; }

@media (max-width: 720px) {
  .hero--compact .hero-inner { padding-top: 34px; padding-bottom: 36px; }
  .hero--compact .hero-title { font-size: 22px; }
}
