@import url("./chat-main.css");

.tools-main-view .main-inner {
  width: min(100%, 1220px);
  padding-top: 42px;
  padding-bottom: 52px;
  overflow-x: hidden;
}

.tools-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.scope-tabs {
  display: flex;
  align-items: center;
  gap: 26px;
}

.scope-tab {
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(18, 20, 23, 0.28);
  font-size: 18px;
  line-height: 28px;
  font-weight: 700;
}

.scope-tab.active {
  color: var(--fs-text-strong);
}

.scope-tab:hover {
  color: var(--fs-text);
}

.category-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
  border-bottom: 1px solid var(--fs-line);
}

.category-strip::-webkit-scrollbar {
  display: none;
}

.category-chip {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--fs-line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--fs-text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 500;
}

.category-chip.active {
  background: rgba(18, 20, 23, 0.05);
  color: var(--fs-text-strong);
  border-color: var(--fs-line-strong);
}

.chip-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.chip-icon.write { background: rgba(91, 141, 239, 0.14); color: var(--fs-blue); }
.chip-icon.code { background: rgba(18, 20, 23, 0.08); color: var(--fs-text-strong); }
.chip-icon.design { background: rgba(255, 159, 67, 0.16); color: var(--fs-orange); }
.chip-icon.fun { background: rgba(245, 196, 81, 0.16); color: #c38d00; }
.chip-icon.market { background: rgba(255, 93, 93, 0.12); color: var(--fs-red); }

.category-progress {
  display: none;
}

.tools-grid-v2 {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
  overflow-x: hidden;
}

.tool-card-v2 {
  min-height: 82px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--fs-line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(18, 20, 23, 0.04);
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 14px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.tool-card-v2:hover {
  transform: translateY(-1px);
  border-color: var(--fs-line-strong);
  box-shadow: 0 16px 28px rgba(18, 20, 23, 0.08);
}

.tool-icon-v2 {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(246,247,249,0.98));
  border: 1px solid var(--fs-line);
}

.tool-copy-v2 {
  min-width: 0;
}

.tool-title-v2 {
  font-size: 15px;
  line-height: 22px;
  font-weight: 700;
  color: var(--fs-text-strong);
}

.tool-desc-v2 {
  margin-top: 2px;
  font-size: 13px;
  line-height: 20px;
  color: var(--fs-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.tool-modal-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(18, 20, 23, 0.34), rgba(18, 20, 23, 0.56)),
    rgba(18, 20, 23, 0.42);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 90;
}

.tool-modal-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.35) 0.7px, transparent 0.7px);
  background-size: 6px 6px;
  opacity: 0.2;
}

.tool-modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.tool-modal {
  position: relative;
  width: min(100%, 1020px);
  max-height: calc(100vh - 88px);
  overflow: auto;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.985);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 42px 110px rgba(18, 20, 23, 0.26);
}

.tool-modal::-webkit-scrollbar {
  width: 10px;
}

.tool-modal::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(18, 20, 23, 0.12);
}

.tool-modal-head {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 38px 38px 28px;
  background: linear-gradient(180deg, #f4f7fd 0%, #f8fbff 100%);
  border-bottom: 1px solid var(--fs-line);
}

.tool-modal-icon {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  background: linear-gradient(180deg, #f8f0df 0%, #f2e7d2 100%);
}

.tool-modal-title {
  font-size: 44px;
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--fs-text-strong);
}

.tool-modal-summary {
  margin-top: 10px;
  font-size: 17px;
  line-height: 1.55;
  color: rgba(18, 20, 23, 0.56);
}

.tool-modal-head-actions {
  display: grid;
  gap: 12px;
  justify-items: end;
}

.tool-modal-close {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--fs-line);
  background: rgba(255, 255, 255, 0.9);
  color: rgba(18, 20, 23, 0.5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tool-modal-close svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.tool-install-btn {
  min-height: 54px;
  padding: 0 28px;
  border-radius: 18px;
  border: 0;
  background: #050505;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 700;
}

.tool-install-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.tool-modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.84fr);
  gap: 32px;
  padding: 30px 38px 38px;
}

.tool-detail-block + .tool-detail-block {
  margin-top: 30px;
}

.tool-detail-title {
  margin: 0 0 14px;
  font-size: 20px;
  line-height: 28px;
  font-weight: 800;
  color: var(--fs-text-strong);
}

.tool-detail-copy {
  margin: 0;
  font-size: 14px;
  line-height: 1.85;
  color: rgba(18, 20, 23, 0.66);
}

.demo-chat {
  display: grid;
  gap: 18px;
}

.demo-title {
  margin: 0;
  font-size: 20px;
  line-height: 28px;
  font-weight: 800;
  color: var(--fs-text-strong);
}

.demo-bubble-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.demo-bubble-row.user {
  justify-content: flex-end;
}

.demo-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.demo-avatar.assistant {
  background: linear-gradient(180deg, #ffe1ef 0%, #ffd1e8 100%);
}

.demo-avatar.user {
  background: linear-gradient(180deg, #eceef2 0%, #dcdfe6 100%);
  color: #111111;
  font-size: 14px;
  font-weight: 700;
}

.demo-bubble {
  max-width: 100%;
  padding: 16px 18px;
  border-radius: 18px;
  background: #6fa168;
  color: rgba(255, 255, 255, 0.96);
  font-size: 14px;
  line-height: 1.75;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

.demo-bubble-row.user .demo-bubble {
  max-width: 76%;
  background: #151619;
  color: rgba(255, 255, 255, 0.94);
}

.demo-code {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.14);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.demo-bubble.result {
  background: #ffffff;
  color: #14171a;
  box-shadow:
    0 10px 24px rgba(18, 20, 23, 0.06),
    inset 0 0 0 1px rgba(18, 20, 23, 0.05);
}

.demo-bubble.result .demo-code {
  background: rgba(18, 20, 23, 0.06);
  color: #1a1d20;
}

.skills-panel {
  display: grid;
  gap: 18px;
}

.skills-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.skills-count {
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(18, 20, 23, 0.08);
  color: rgba(18, 20, 23, 0.56);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.skills-subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  color: rgba(18, 20, 23, 0.58);
}

.skill-card {
  min-height: 78px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(18, 20, 23, 0.08);
  background: rgba(255, 255, 255, 0.98);
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.skill-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: rgba(255, 255, 255, 0.95);
}

.skill-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.skill-name {
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
  color: var(--fs-text-strong);
}

.skill-badge {
  min-height: 22px;
  padding: 0 8px;
  border-radius: 8px;
  background: #1d4fff;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
}

.skill-desc {
  margin-top: 4px;
  font-size: 14px;
  line-height: 22px;
  color: rgba(18, 20, 23, 0.58);
}

@media (max-width: 1160px) {
  .tools-grid-v2 {
    grid-template-columns: 1fr;
  }

  .tool-modal-head,
  .tool-modal-body {
    grid-template-columns: 1fr;
  }

  .tool-modal-title {
    font-size: 40px;
  }

  .tool-modal-summary,
  .tool-detail-copy,
  .tool-link-text,
  .install-desc {
    font-size: 16px;
    line-height: 1.7;
  }

  .install-item {
    grid-template-columns: auto 1fr;
  }

  .tree-panel {
    min-height: auto;
  }
}
