/* WP Web Tools — 工具列表卡片样式(短代码输出)
   中性配色,跟随主题字体;在深色主题下也有基本可读性 */
.wwt-tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 1.5em 0;
}

.wwt-tool-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  background: #fff;
  color: #1f2937;
  text-decoration: none !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.wwt-tool-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
}

.wwt-tool-name {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  color: #111827;
}

.wwt-tool-desc {
  flex: 1;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #6b7280;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wwt-tool-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
  font-size: 0.8rem;
}

.wwt-tool-slug {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #9ca3af;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wwt-tool-open {
  flex-shrink: 0;
  font-weight: 600;
  color: #2563eb;
}

.wwt-empty {
  color: #6b7280;
}

/* ---- Detail view (tool in an iframe with a "Back to list" bar) ----
   Visibility is toggled by assets/front.js via the [hidden] attribute. */
.wwt-app .wwt-tool-grid.is-hidden {
  display: none;
}

.wwt-detail {
  margin: 1.5em 0;
}

.wwt-detail[hidden] {
  display: none;
}

.wwt-detail-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.wwt-back {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  background: #fff;
  color: #1f2937 !important;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none !important;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.wwt-back:hover {
  border-color: #2563eb;
  background: #eff6ff;
}

.wwt-detail-title {
  flex: 1;
  font-size: 1.02rem;
  font-weight: 600;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wwt-newtab {
  flex-shrink: 0;
  font-size: 0.85rem;
  color: #2563eb !important;
  text-decoration: none !important;
}
.wwt-newtab:hover {
  text-decoration: underline !important;
}

.wwt-detail-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 200px);
  min-height: 600px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  background: #fff;
}

@media (max-width: 600px) {
  .wwt-tool-grid {
    grid-template-columns: 1fr;
  }
}
