/* bento-grid.css — Kokonut UI Bento Grid 风格
   参考: https://21st.dev/community/components/kokonutd/bento-grid/default */

.bento-wrap {
  display: none;
  width: 100%;
  height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.bento-wrap.is-visible {
  display: block;
  min-height: 100%;
  padding: 24px 20px;
  box-sizing: border-box;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 320px));
  grid-auto-flow: row;
  justify-content: start;
  align-content: start;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 0;
}

.bento-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border-radius: var(--rounded-xl);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--hairline) 80%, transparent);
  background: var(--background);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  will-change: transform;
}

.bento-card:hover,
.bento-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  border-color: color-mix(in srgb, var(--hairline) 100%, transparent);
  outline: none;
}

.bento-card__dots {
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  background-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
  background-size: 4px 4px;
}

.bento-card:hover .bento-card__dots,
.bento-card:focus-visible .bento-card__dots {
  opacity: 1;
}

.bento-card__glow {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  padding: 1px;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: linear-gradient(135deg, transparent, color-mix(in srgb, var(--hairline) 50%, transparent), transparent);
}

.bento-card:hover .bento-card__glow,
.bento-card:focus-visible .bento-card__glow {
  opacity: 1;
}

.bento-card__body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.bento-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bento-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--rounded-md);
  background: color-mix(in srgb, var(--foreground) 5%, transparent);
  transition: background 0.3s ease;
}

.bento-card:hover .bento-card__icon,
.bento-card:focus-visible .bento-card__icon {
  background: color-mix(in srgb, var(--foreground) 8%, transparent);
}

.bento-card__icon-svg {
  width: 16px;
  height: 16px;
}

.bento-card__icon--blue   { color: #3b82f6; }
.bento-card__icon--violet { color: #8b5cf6; }
.bento-card__icon--green  { color: #22c55e; }

.bento-card__status {
  flex-shrink: 0;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  color: var(--muted-foreground);
  border-radius: var(--rounded-md);
  background: color-mix(in srgb, var(--foreground) 5%, transparent);
  backdrop-filter: blur(4px);
  transition: background 0.3s ease;
}

.bento-card:hover .bento-card__status,
.bento-card:focus-visible .bento-card__status {
  background: color-mix(in srgb, var(--foreground) 10%, transparent);
}

.bento-card__title {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--foreground);
}

.bento-card__meta {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted-foreground);
}

.bento-card__desc {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 425;
  line-height: 1.45;
  color: var(--body);
}

.bento-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.bento-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bento-card__tag {
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1;
  color: var(--muted-foreground);
  border-radius: var(--rounded-md);
  background: color-mix(in srgb, var(--foreground) 5%, transparent);
  transition: background 0.2s ease;
}

.bento-card:hover .bento-card__tag,
.bento-card:focus-visible .bento-card__tag {
  background: color-mix(in srgb, var(--foreground) 10%, transparent);
}

.bento-card__cta {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--muted-foreground);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bento-card:hover .bento-card__cta,
.bento-card:focus-visible .bento-card__cta {
  opacity: 1;
}

.bento-empty {
  grid-column: 1 / -1;
  padding: 48px 16px;
  text-align: center;
  color: var(--muted-foreground);
  font-size: 14px;
}

/* Explorer toolbar + list view */
.explorer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--hairline) 80%, transparent);
}

.explorer-toolbar__info {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.explorer-toolbar__title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.explorer-toolbar__meta {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--muted-foreground);
}

.explorer-toolbar__actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  padding: 3px;
  border-radius: var(--rounded-md);
  background: color-mix(in srgb, var(--foreground) 4%, transparent);
}

.explorer-view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: calc(var(--rounded-md) - 2px);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.explorer-view-btn svg {
  width: 16px;
  height: 16px;
}

.explorer-view-btn:hover,
.explorer-view-btn:focus-visible {
  color: var(--foreground);
  outline: none;
}

.explorer-view-btn.is-active {
  background: var(--background);
  color: var(--foreground);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.explorer-body {
  width: 100%;
}

.explorer-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

.explorer-list__head,
.explorer-list__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px 72px 88px;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
}

.explorer-list__head {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
  border-bottom: 1px solid color-mix(in srgb, var(--hairline) 70%, transparent);
}

.explorer-list__row {
  padding: 10px 12px;
  border: none;
  border-radius: var(--rounded-md);
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}

.explorer-list__row:hover,
.explorer-list__row:focus-visible {
  background: color-mix(in srgb, var(--foreground) 4%, transparent);
  outline: none;
}

.explorer-list__cell--name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.explorer-list__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: var(--rounded-md);
  background: color-mix(in srgb, var(--foreground) 5%, transparent);
}

.explorer-list__icon-svg {
  width: 14px;
  height: 14px;
}

.explorer-list__icon--blue   { color: #3b82f6; }
.explorer-list__icon--violet { color: #8b5cf6; }
.explorer-list__icon--green  { color: #22c55e; }

.explorer-list__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
}

.explorer-list__cell--type,
.explorer-list__cell--count {
  font-size: 13px;
  color: var(--muted-foreground);
}

.explorer-list__cell--action {
  font-size: 12px;
  color: var(--muted-foreground);
  text-align: right;
}

@media (max-width: 640px) {
  .explorer-list__head {
    display: none;
  }

  .explorer-list__row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
  }

  .explorer-list__cell--type,
  .explorer-list__cell--count {
    display: none;
  }

  .explorer-list__cell--action {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
  }
}
