body.tool-shell-page {
  margin: 0 !important;
  padding: 45px 0 0 !important;
  min-height: 100vh !important;
  background: linear-gradient(180deg, #f4f6fb 0%, #eef2ff 100%) !important;
  display: block !important;
  color: #1f2937;
}

body.tool-shell-page .back-btn {
  display: none !important;
}

.tool-shell-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(67, 56, 202, 0.2);
}

.tool-shell-header-inner {
  width: min(1400px, calc(100% - 24px));
  margin: 0 auto;
  min-height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

.tool-shell-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  background: linear-gradient(45deg, #FFD700, #FFA500, #FF6347, #FFD700);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease-in-out infinite;
  white-space: nowrap;
  font-size: clamp(0.82rem, 1.8vw, 1.1rem);
  font-weight: 700;
  font-family: 'KaiTi', '楷体', serif;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.tool-shell-brand i {
  -webkit-text-fill-color: #FFD700;
  flex-shrink: 0;
  filter: drop-shadow(0 0 5px rgba(255,215,0,0.5));
}

.tool-shell-mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

.tool-shell-nav {
  flex: 0 0 auto;
  min-width: 0;
}

.tool-shell-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.35rem;
  justify-content: center;
  flex-wrap: nowrap;
}

.tool-shell-nav ul li {
  flex: 0 0 auto;
}

.tool-shell-nav a {
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
  white-space: nowrap;
  font-size: 0.8rem;
  transition: background 0.25s ease;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 500;
}

.tool-shell-nav a:hover,
.tool-shell-nav a.active {
  background: rgba(255, 255, 255, 0.18);
}

.tool-shell-main {
  width: min(1400px, calc(100% - 24px));
  margin: 1.2rem auto 2rem;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
}

.tool-shell-sidebar {
  position: sticky;
  top: 61px;
}

.tool-shell-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(102, 126, 234, 0.12);
  box-shadow: 0 18px 36px rgba(99, 102, 241, 0.12);
  border-radius: 24px;
  padding: 1rem;
}

.tool-shell-card h2,
.tool-shell-card h3 {
  margin: 0;
  font-size: 1rem;
  color: #111827;
}

.tool-shell-card-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.tool-shell-card-header span {
  font-size: 0.8rem;
  color: #6b7280;
}

.tool-shell-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tool-shell-mobile-toggle {
  display: none;
  color: #6b7280;
}

.tool-shell-category-list {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.tool-shell-category-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 16px;
  color: #334155;
  padding: 0.8rem 0.85rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.22s ease;
}

.tool-shell-category-btn:hover {
  background: #eef2ff;
  color: #4f46e5;
}

.tool-shell-category-btn.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  box-shadow: 0 12px 24px rgba(102, 126, 234, 0.2);
}

.tool-shell-category-meta {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  min-width: 0;
}

.tool-shell-category-meta i {
  width: 1rem;
  text-align: center;
}

.tool-shell-category-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
  font-weight: 600;
}

.tool-shell-count {
  font-size: 0.8rem;
  opacity: 0.88;
}

.tool-shell-panel {
  min-width: 0;
}

.tool-shell-toolbar {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(102, 126, 234, 0.12);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.12);
  border-radius: 28px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.15rem;
}

.tool-shell-search-box {
  position: relative;
}

.tool-shell-search-box i {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: #818cf8;
}

input.tool-shell-search-input[type="text"] {
  width: 100%;
  border: 1px solid #dbe2f6;
  border-radius: 18px;
  background: #f8faff;
  padding: 0.8rem 1rem 0.8rem 3rem !important;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.tool-shell-search-input:focus {
  border-color: #667eea;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12);
}

.tool-shell-content {
  min-width: 0;
}

.tool-shell-content[hidden],
.tool-shell-browser[hidden] {
  display: none !important;
}

.tool-shell-content > * {
  width: 100%;
}

.tool-shell-content .wrapper {
  margin: 0 auto;
}

.tool-shell-browser {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(102, 126, 234, 0.12);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.12);
  border-radius: 28px;
  padding: 1.2rem;
}

.tool-shell-browser-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tool-shell-browser-head h2 {
  margin: 0;
  color: #111827;
  font-size: 1.2rem;
}

.tool-shell-browser-head p {
  margin: 0.28rem 0 0;
  color: #6b7280;
  font-size: 0.92rem;
}

.tool-shell-browser-count {
  flex-shrink: 0;
  border-radius: 999px;
  background: #eef2ff;
  color: #4f46e5;
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.tool-shell-browser-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.tool-shell-tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
  min-width: 0;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  padding: 1.15rem;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.tool-shell-tool-card:hover {
  transform: translateY(-4px);
  border-color: #c7d2fe;
  box-shadow: 0 18px 30px rgba(99, 102, 241, 0.14);
}

.tool-shell-tool-card.current {
  border-color: #c7d2fe;
  background: linear-gradient(180deg, #fefeff 0%, #f4f7ff 100%);
}

.tool-shell-tool-card-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.tool-shell-tool-icon {
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #eef2ff, #ede9fe);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4f46e5;
  flex-shrink: 0;
}

.tool-shell-tool-title {
  min-width: 0;
}

.tool-shell-tool-title h3 {
  margin: 0 0 0.15rem;
  color: #111827;
  font-size: 1.02rem;
}

.tool-shell-tool-title span {
  display: block;
  color: #6b7280;
  font-size: 0.82rem;
}

.tool-shell-tool-desc {
  margin: 0;
  color: #4b5563;
  font-size: 0.9rem;
  line-height: 1.65;
  flex: 1;
}

.tool-shell-tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tool-shell-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.62rem;
  border-radius: 999px;
  background: #f5f7ff;
  color: #4f46e5;
  font-size: 0.75rem;
}

.tool-shell-tool-action {
  align-self: flex-start;
  font-size: 0.82rem;
  font-weight: 700;
  color: #4f46e5;
}

.tool-shell-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: #64748b;
}

.tool-shell-empty-state i {
  font-size: 2.6rem;
  color: #a5b4fc;
  margin-bottom: 1rem;
}

.tool-shell-empty-state h3 {
  margin: 0 0 0.5rem;
  color: #111827;
  font-size: 1.1rem;
}

.tool-shell-empty-state p {
  margin: 0;
  font-size: 0.92rem;
}

@media (max-width: 980px) {
  body.tool-shell-page {
    padding-top: 93px !important;
  }

  .tool-shell-header-inner {
    padding: 0.35rem 0;
  }

  .tool-shell-main {
    grid-template-columns: 1fr;
  }

  .tool-shell-sidebar {
    position: static;
  }

  .tool-shell-card {
    padding: 0.85rem;
  }

  .tool-shell-mobile-toggle {
    display: inline-block;
  }

  .tool-shell-category-list {
    display: none;
  }

  .tool-shell-category-list.is-expanded {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.55rem;
    margin-top: 1rem;
  }

  .tool-shell-browser-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .tool-shell-mobile-menu-btn { display: block; }
  .tool-shell-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 1rem; }
  .tool-shell-nav.open { display: block; }
  .tool-shell-nav ul { flex-direction: column; gap: 0.5rem; }
  .tool-shell-brand { font-size: clamp(0.85rem, 4.5vw, 1.3rem); }
}

@media (max-width: 640px) {
  body.tool-shell-page {
    padding-top: 89px !important;
  }

  .tool-shell-main,
  .tool-shell-header-inner {
    width: min(100% - 16px, 1400px);
  }

  .tool-shell-toolbar {
    padding: 1rem;
    border-radius: 22px;
  }

  .tool-shell-browser {
    padding: 1rem;
    border-radius: 22px;
  }

  .tool-shell-category-list.is-expanded {
    grid-template-columns: 1fr 1fr;
  }

  .tool-shell-browser-head {
    flex-direction: column;
  }

  .tool-shell-browser-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 400px) {
  .tool-shell-brand { font-size: 0.85rem; }
}
