/* ============================================================
 * opc-ai-tool.css — AI工具（opc_ai_tool）列表页 + 详情页专属样式
 * 仅在 opc_ai_tool 归档/详情自动加载（见 opc-functions.php map）。
 * 复用 tokens.css 变量与 components.css 既有语言，覆盖写这里。
 * 参考：refer/04.png（列表）+ 范式B（详情：大图+主栏+右推荐栏）。
 * ============================================================ */

/* ---------- 列表页：外框 ---------- */
/* .page-frame 尺寸/间距对齐创意种子页（archive-opc_idea.php），
 * 直接沿用 components.css 基础 .page-frame，不再单独覆盖 margin/padding。 */

/* ---------- 列表页：筛选面板（对齐 refer/04 顶部面板） ---------- */
.opc-tool-filter {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #f4f7ff 0%, #fafbff 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px 28px 26px;
  margin-bottom: 28px;
}
.opc-tool-filter::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 220px;
  pointer-events: none; z-index: 0; filter: blur(4px);
  background:
    radial-gradient(ellipse 60% 100% at 30% -10%, rgba(var(--accent-rgb), .22), transparent 62%),
    radial-gradient(ellipse 55% 90% at 78% -6%, rgba(124, 92, 255, .16), transparent 60%);
}
.opc-tool-filter > * { position: relative; z-index: 1; }
.opc-tool-filter-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.opc-tool-filter-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.opc-tool-reset {
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  padding: 6px 16px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: rgba(255,255,255,.7);
  cursor: pointer; transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.opc-tool-reset:hover { color: var(--accent); border-color: var(--accent); background: #fff; }

.opc-tool-filter-row { display: flex; align-items: baseline; gap: 18px; }
.opc-tool-filter-row + .opc-tool-filter-row { margin-top: 14px; }
.opc-tool-filter-key {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--text);
  width: 84px; flex-shrink: 0;
}
.opc-tool-filter-key svg { width: 15px; height: 15px; color: var(--accent); flex-shrink: 0; }
.opc-tool-chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1 1 0%; min-width: 0; }
.opc-tool-chip {
  font-size: 13px; color: var(--muted); font-family: inherit;
  padding: 6px 15px; border-radius: var(--radius-pill);
  border: 1px solid transparent; background: transparent; cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.opc-tool-chip:hover { color: var(--text); background: rgba(var(--accent-rgb), .07); }
.opc-tool-chip.active {
  color: #fff; font-weight: 600;
  background: linear-gradient(120deg, #4d6bfe 0%, #7c5cff 100%);
  border-color: transparent;
  box-shadow: 0 6px 14px -6px rgba(var(--accent-rgb), .55);
}

/* ---------- 列表页：结果条 + 投稿入口 ---------- */
.opc-tool-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.opc-tool-count { font-size: 14px; color: var(--muted); }
.opc-tool-count b { color: var(--text); font-weight: 700; }
.opc-tool-submit {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: #fff; text-decoration: none;
  padding: 9px 18px; border-radius: var(--radius-pill);
  background: linear-gradient(120deg, #4d6bfe 0%, #7c5cff 100%);
  box-shadow: 0 6px 16px -4px rgba(77, 107, 254, .42);
  transition: transform .15s ease, box-shadow .15s ease;
}
.opc-tool-submit:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -6px rgba(77, 107, 254, .5); }
.opc-tool-submit svg { width: 14px; height: 14px; }

/* ---------- 列表页：网址导航式三列网格（样式对齐首页 opc-home-navgrid / opc-nav-card，见 opc-home.css）---------- */
.page-frame .opc-home-navgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--surface);
}
.page-frame .opc-nav-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: background-color .18s ease;
}
.page-frame .opc-nav-card:nth-child(-n+3) { border-top: none; }
.page-frame .opc-nav-card:nth-child(3n+1) { border-left: none; }
.page-frame .opc-nav-card:hover { background: var(--accent-soft); }
.page-frame .opc-nav-card:hover .opc-nav-name { color: var(--accent); }
.page-frame .opc-nav-icon {
  width: 40px; height: 40px; margin-top: 2px;
  border-radius: 10px; flex-shrink: 0; object-fit: cover;
  background: var(--surface);
}
.page-frame .opc-nav-icon--ph {
  display: flex; align-items: center; justify-content: center;
  background: #f0f0f2; color: #9a9aa2;
  font-size: 12px; font-weight: 600; font-family: var(--font-display);
}
body.style-for-dark .page-frame .opc-nav-icon--ph {
  background: #33343a; color: #8a8b93;
}
.page-frame .opc-nav-text { min-width: 0; flex: 1; }
.page-frame .opc-nav-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.page-frame .opc-nav-name {
  min-width: 0; flex: 0 1 auto;
  font-size: 14px; font-weight: 700; color: var(--text);
  line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .18s ease;
}
.page-frame .opc-nav-desc {
  margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.page-frame .opc-nav-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.page-frame .opc-nav-tags .pill.opc-nav-tag {
  padding: 2px 9px; font-size: 11px; line-height: 1.6;
  background: var(--surface); color: var(--muted); border: 1px solid var(--line);
}
@media (max-width: 860px) {
  .page-frame .opc-home-navgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-frame .opc-nav-card { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
  .page-frame .opc-nav-card:nth-child(-n+2) { border-top: none; }
  .page-frame .opc-nav-card:nth-child(2n+1) { border-left: none; }
}
@media (max-width: 560px) {
  .page-frame .opc-home-navgrid { grid-template-columns: 1fr; }
  .page-frame .opc-nav-card { border-left: none; border-top: 1px solid var(--line); }
  .page-frame .opc-nav-card:first-child { border-top: none; }
}
.opc-tool-logo-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 22px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #4d6bfe 0%, #7c5cff 100%);
}

/* ---------- 空状态 ---------- */
.opc-tool-empty { text-align: center; color: var(--muted); font-size: 14px; padding: 64px 0; }

/* ============================================================
 * 详情页（范式B：大图 hero + 主栏 + 右推荐栏）
 * ============================================================ */
.opc-tool-detail { max-width: 1160px; margin: 28px auto 72px; padding: 0 24px; }
.opc-tool-detail .back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted-2); text-decoration: none; margin-bottom: 18px; transition: color .15s ease; }
.opc-tool-detail .back-link:hover { color: var(--accent); }

/* Hero 大图区 */
.opc-tool-hero {
  position: relative; overflow: hidden;
  border-radius: 22px; border: 1px solid var(--line);
  background: linear-gradient(120deg, #eef2ff 0%, #f6f0ff 55%, #fdf0f6 100%);
  padding: 40px 44px; margin-bottom: 32px;
  display: flex; align-items: center; gap: 28px;
}
.opc-tool-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0; filter: blur(6px);
  background:
    radial-gradient(ellipse 46% 120% at 12% -10%, rgba(var(--accent-rgb), .28), transparent 60%),
    radial-gradient(ellipse 40% 110% at 88% 120%, rgba(124, 92, 255, .22), transparent 62%);
}
.opc-tool-hero > * { position: relative; z-index: 1; }
.opc-tool-hero-logo {
  width: 96px; height: 96px; flex-shrink: 0; border-radius: 24px; overflow: hidden;
  background: #fff; border: 1px solid rgba(255,255,255,.8);
  box-shadow: 0 12px 30px -12px rgba(var(--accent-rgb), .4);
  display: flex; align-items: center; justify-content: center;
}
.opc-tool-hero-logo img { width: 100%; height: 100%; object-fit: cover; }
.opc-tool-hero-logo .opc-tool-logo-fallback { font-size: 40px; border-radius: 0; }
.opc-tool-hero-body { flex: 1; min-width: 0; }
.opc-tool-hero-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.opc-tool-hero-title { font-family: var(--font-display); font-size: 32px; font-weight: 700; letter-spacing: -.02em; color: var(--text); line-height: 1.15; }
.opc-tool-hero-stage {
  font-size: 12.5px; font-weight: 600; color: var(--accent);
  background: rgba(255,255,255,.75); border: 1px solid rgba(var(--accent-rgb), .25);
  padding: 4px 13px; border-radius: var(--radius-pill);
}
.opc-tool-hero-desc { font-size: 15px; color: #4a4d57; line-height: 1.7; max-width: 620px; margin-bottom: 22px; }
.opc-tool-hero-cta {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: #fff; text-decoration: none;
  padding: 11px 26px; border-radius: var(--radius-pill);
  background: linear-gradient(120deg, #4d6bfe 0%, #7c5cff 100%);
  box-shadow: 0 10px 24px -8px rgba(77, 107, 254, .5);
  transition: transform .15s ease, box-shadow .15s ease;
}
.opc-tool-hero-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -8px rgba(77, 107, 254, .58); }
.opc-tool-hero-cta svg { width: 15px; height: 15px; }

/* 主栏 + 右栏两列布局 */
.opc-tool-detail-body { display: grid; grid-template-columns: 1fr 300px; gap: 44px; align-items: start; }
.opc-tool-main {}
.opc-tool-section { margin-bottom: 34px; }
.opc-tool-section-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-2); margin-bottom: 14px; }
.opc-tool-section-text { font-size: 14.5px; color: #3d4048; line-height: 1.85; }
.opc-tool-fieldgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.opc-tool-fieldgrid .k { font-size: 10.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px; }
.opc-tool-fieldgrid .v { font-size: 14px; font-weight: 700; color: var(--text); word-break: break-all; }
.opc-tool-fieldgrid .v a { color: var(--accent); text-decoration: none; }
.opc-tool-fieldgrid .v a:hover { text-decoration: underline; }

/* 右栏推荐 */
.opc-tool-aside .sb-block { margin-bottom: 28px; }
.opc-tool-aside-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-card); padding: 20px;
}
.opc-tool-reco {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--line); text-decoration: none; color: inherit;
  transition: opacity .15s ease;
}
.opc-tool-reco:last-child { border-bottom: none; padding-bottom: 0; }
.opc-tool-reco:first-child { padding-top: 0; }
.opc-tool-reco:hover .opc-tool-reco-name { color: var(--accent); }
.opc-tool-reco-logo {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 11px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.opc-tool-reco-logo img { width: 100%; height: 100%; object-fit: cover; }
.opc-tool-reco-logo .opc-tool-logo-fallback { font-size: 16px; border-radius: 0; }
.opc-tool-reco-body { min-width: 0; }
.opc-tool-reco-name { font-size: 13.5px; font-weight: 700; color: var(--text); transition: color .15s ease; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opc-tool-reco-desc { font-size: 11.5px; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 形态徽章（属性字段，区别于分类 tag） ---------- */
.page-frame .opc-nav-tags .pill.opc-nav-shape {
  background: var(--accent-soft); color: var(--accent);
  border-color: rgba(var(--accent-rgb), .25); font-weight: 600;
}
.opc-tool-hero-stage.opc-tool-hero-shape {
  color: #fff; background: linear-gradient(120deg, #4d6bfe 0%, #7c5cff 100%);
  border-color: transparent;
}

/* ============================================================
 * 响应式
 * ============================================================ */
@media (max-width: 920px) {
  .opc-tool-grid { grid-template-columns: repeat(2, 1fr); }
  .opc-tool-detail-body { grid-template-columns: 1fr; gap: 8px; }
  .opc-tool-aside { margin-top: 12px; }
  .opc-tool-hero { padding: 30px 26px; }
  .opc-tool-hero-title { font-size: 27px; }
}
@media (max-width: 768px) {
  .opc-tool-grid { grid-template-columns: 1fr; }
  .opc-tool-filter { padding: 20px 18px 22px; }
  .opc-tool-filter-row { flex-direction: column; gap: 8px; }
  .opc-tool-filter-key { width: auto; }
  .opc-tool-hero { flex-direction: column; align-items: flex-start; gap: 18px; text-align: left; padding: 26px 20px; }
  .opc-tool-hero-title { font-size: 24px; }
  .opc-tool-fieldgrid { grid-template-columns: 1fr; }
}

/* ============================================================
 * 2026-07-14 需求：个人中心 AI工具 tab 复刻 tools/ 归档页卡片样式。
 * profile 页 DOM 无 .page-frame 祖先（外层为 .opc-profile-arc），
 * 上方所有 .page-frame .opc-nav-* 规则命中不到，故此处 1:1 等价复刻，
 * 作用域改为 .opc-profile-arc.opc-arc--ai-tool，保持与归档页视觉完全一致。
 * ============================================================ */
.opc-profile-arc.opc-arc--ai-tool .opc-home-navgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--surface);
}
.opc-profile-arc.opc-arc--ai-tool .opc-nav-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: background-color .18s ease;
}
.opc-profile-arc.opc-arc--ai-tool .opc-nav-card:nth-child(-n+3) { border-top: none; }
.opc-profile-arc.opc-arc--ai-tool .opc-nav-card:nth-child(3n+1) { border-left: none; }
.opc-profile-arc.opc-arc--ai-tool .opc-nav-card:hover { background: var(--accent-soft); }
.opc-profile-arc.opc-arc--ai-tool .opc-nav-card:hover .opc-nav-name { color: var(--accent); }
.opc-profile-arc.opc-arc--ai-tool .opc-nav-icon {
  width: 40px; height: 40px; margin-top: 2px;
  border-radius: 10px; flex-shrink: 0; object-fit: cover;
  background: var(--surface);
}
.opc-profile-arc.opc-arc--ai-tool .opc-nav-icon--ph {
  display: flex; align-items: center; justify-content: center;
  background: #f0f0f2; color: #9a9aa2;
  font-size: 12px; font-weight: 600; font-family: var(--font-display);
}
body.style-for-dark .opc-profile-arc.opc-arc--ai-tool .opc-nav-icon--ph {
  background: #33343a; color: #8a8b93;
}
.opc-profile-arc.opc-arc--ai-tool .opc-nav-text { min-width: 0; flex: 1; }
.opc-profile-arc.opc-arc--ai-tool .opc-nav-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.opc-profile-arc.opc-arc--ai-tool .opc-nav-name {
  min-width: 0; flex: 0 1 auto;
  font-size: 14px; font-weight: 700; color: var(--text);
  line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .18s ease;
}
.opc-profile-arc.opc-arc--ai-tool .opc-nav-desc {
  margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.opc-profile-arc.opc-arc--ai-tool .opc-nav-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.opc-profile-arc.opc-arc--ai-tool .opc-nav-tags .pill.opc-nav-tag {
  padding: 2px 9px; font-size: 11px; line-height: 1.6;
  background: var(--surface); color: var(--muted); border: 1px solid var(--line);
}
.opc-profile-arc.opc-arc--ai-tool .opc-nav-tags .pill.opc-nav-shape {
  background: var(--accent-soft); color: var(--accent);
  border-color: rgba(var(--accent-rgb), .25); font-weight: 600;
}
@media (max-width: 860px) {
  .opc-profile-arc.opc-arc--ai-tool .opc-home-navgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opc-profile-arc.opc-arc--ai-tool .opc-nav-card { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
  .opc-profile-arc.opc-arc--ai-tool .opc-nav-card:nth-child(-n+2) { border-top: none; }
  .opc-profile-arc.opc-arc--ai-tool .opc-nav-card:nth-child(2n+1) { border-left: none; }
}
@media (max-width: 560px) {
  .opc-profile-arc.opc-arc--ai-tool .opc-home-navgrid { grid-template-columns: 1fr; }
  .opc-profile-arc.opc-arc--ai-tool .opc-nav-card { border-left: none; border-top: 1px solid var(--line); }
  .opc-profile-arc.opc-arc--ai-tool .opc-nav-card:first-child { border-top: none; }
}

/* ------------------------------------------------------------------
 * 个人中心本人主页：AI 工具卡被 .opc-nav-card-wrap 包裹（为前台编辑钮提供
 * 定位锚点）。此时 wrapper 成为 grid item，须把网格分隔边框职责从内层
 * .opc-nav-card 迁移到 wrapper，内层卡去边框，保持三列分隔线不塌。
 * 自己主页里全部 AI 工具卡均归本人所有→全部统一包裹，结构一致。
 * ------------------------------------------------------------------ */
.opc-profile-arc.opc-arc--ai-tool .opc-home-navgrid .opc-nav-card-wrap {
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.opc-profile-arc.opc-arc--ai-tool .opc-nav-card-wrap:nth-child(-n+3) { border-top: none; }
.opc-profile-arc.opc-arc--ai-tool .opc-nav-card-wrap:nth-child(3n+1) { border-left: none; }
.opc-profile-arc.opc-arc--ai-tool .opc-nav-card-wrap .opc-nav-card {
  border-top: none;
  border-left: none;
  height: 100%;
}
@media (max-width: 860px) {
  .opc-profile-arc.opc-arc--ai-tool .opc-nav-card-wrap {
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
  }
  .opc-profile-arc.opc-arc--ai-tool .opc-nav-card-wrap:nth-child(-n+3) { border-top: 1px solid var(--line); }
  .opc-profile-arc.opc-arc--ai-tool .opc-nav-card-wrap:nth-child(-n+2) { border-top: none; }
  .opc-profile-arc.opc-arc--ai-tool .opc-nav-card-wrap:nth-child(3n+1) { border-left: 1px solid var(--line); }
  .opc-profile-arc.opc-arc--ai-tool .opc-nav-card-wrap:nth-child(2n+1) { border-left: none; }
}
@media (max-width: 560px) {
  .opc-profile-arc.opc-arc--ai-tool .opc-nav-card-wrap {
    border-left: none;
    border-top: 1px solid var(--line);
  }
  .opc-profile-arc.opc-arc--ai-tool .opc-nav-card-wrap:first-child { border-top: none; }
}

