/* 云工具目录 v2：工具栏 + 侧边栏 + 大图卡片 */

/* 本页壳层：去掉 .dashboard-page-tools-hub 的 1560px 居中限制，导航整宽 */
.dashboard-page-tools-hub .dashboard-app { display: block; }
.dashboard-page-tools-hub .dashboard-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 40px;
}
.dashboard-page-tools-hub .dashboard-topbar {
  position: static;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.tc-page {
  /* .dashboard-main 是 flex 列容器，auto 外边距会让子项失去 stretch 而按内容收缩，
     切换到一个空结果（如「会员专享 0」）时整页会变窄，所以显式给宽度 */
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 20px 28px 64px;
  font-family: var(--font-sans, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif);
  color: var(--text, #16365c);
}
.tc-layout {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  min-width: 0;
  gap: 22px;
  align-items: start;
}

/* ---------- 侧边栏 ---------- */
.tc-side {
  background: #fff; border: 1px solid rgba(29, 103, 178, 0.12);
  border-radius: 16px; padding: 10px; box-shadow: 0 2px 8px rgba(21, 52, 92, 0.05);
}
.tc-side-group + .tc-side-group { margin-top: 12px; padding-top: 11px; border-top: 1px dashed rgba(29, 103, 178, 0.12); }
.tc-side-title { font-size: 11px; letter-spacing: 1.2px; color: #8ba0bb; font-weight: 600; padding: 2px 8px 8px; }
.tc-side-item {
  position: relative;
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 9px; border: 0; background: transparent; border-radius: 9px;
  font: inherit; font-size: 13.5px; color: #2b4f7d; text-align: left; cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.tc-side-icon { color: var(--cat, #9db2ca); flex: 0 0 auto; opacity: 0.9; }
.tc-side-item:hover { background: var(--cat-tint, #f3f8fd); }
.tc-side-item.is-active { background: var(--cat-tint, #eaf2fc); color: var(--cat, #1d67b2); font-weight: 600; }
.tc-side-item.is-active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--cat, #1d67b2);
}
.tc-side-item.is-active .tc-side-icon { color: var(--cat, #1d67b2); opacity: 1; }
.tc-side-item .tc-count {
  margin-left: auto; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--cat, #8ba0bb); background: var(--cat-tint, transparent);
  padding: 1px 7px; border-radius: 999px; min-width: 26px; text-align: center;
}
.tc-side-item.is-active .tc-count { color: #fff; background: var(--cat, #1d67b2); }
.tc-side-dot { width: 8px; height: 8px; border-radius: 3px; background: currentColor; opacity: 1; flex: 0 0 auto; }

/* ---------- 工具栏 ---------- */
.tc-toolbar-wrap { margin: 0 0 10px; }
.tc-toolbar {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 10px; flex-wrap: nowrap;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid rgba(29, 103, 178, 0.12); border-radius: 12px;
  padding: 7px 10px; box-shadow: 0 2px 8px rgba(21, 52, 92, 0.05);
}
.tc-toolbar::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, #1d67b2 0%, #4aa3df 38%, #37b58a 68%, #f0a531 100%);
  opacity: 0.75;
}
.tc-tabs { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.tc-tab {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; font: inherit; font-size: 15px; font-weight: 500; color: #24456b;
  padding: 8px 13px; border-radius: 9px; white-space: nowrap; cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.tc-tab::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--tier, #1d67b2); opacity: 0.85; flex: 0 0 auto;
}
.tc-tab[data-tier="all"] { --tier: #1d67b2; --tier-tint: #eaf2fc; }
.tc-tab[data-tier="free"] { --tier: #0f9967; --tier-tint: #e9f7ef; }
.tc-tab[data-tier="member"] { --tier: #b7791f; --tier-tint: #fdf3dd; }
.tc-tab:hover { background: var(--tier-tint, #f2f7fd); color: var(--tier, #1d67b2); }
.tc-tab.is-active {
  background: var(--tier, #1d67b2); color: #fff; font-weight: 600;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--tier, #1d67b2) 34%, transparent);
}
.tc-tab.is-active::before { background: #fff; opacity: 0.92; }
.tc-tab-count {
  margin-left: 2px; font-size: 13px; font-weight: 700; letter-spacing: 0.2px;
  opacity: 0.66; font-variant-numeric: tabular-nums;
}
.tc-tab.is-active .tc-tab-count { opacity: 0.85; }
.tc-sorts { display: flex; align-items: center; gap: 2px; padding-left: 10px; border-left: 1px solid rgba(29, 103, 178, 0.12); flex: 0 0 auto; }
.tc-sort {
  display: flex; align-items: center; gap: 5px; border: 0; background: transparent; font: inherit;
  font-size: 14.5px; font-weight: 500; color: #45658a; padding: 8px 10px; border-radius: 8px; white-space: nowrap; cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.tc-sort[data-sort="rec"] svg { color: #1d67b2; opacity: 0.85; }
.tc-sort[data-sort="new"] svg { color: #6f5bd8; opacity: 0.85; }
.tc-sort[data-sort="hot"] svg { color: #e0612c; opacity: 0.85; }
.tc-sort:hover { color: #16365c; background: #eef5fc; }
.tc-sort.is-active { color: #12324f; font-weight: 700; background: #e4effb; }
.tc-search { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; justify-content: flex-end; }
.tc-search-field { position: relative; flex: 1 1 auto; min-width: 180px; max-width: 640px; }
.tc-search-field svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #a3b4c9; }
.tc-search-field input {
  width: 100%; height: 38px; border: 1px solid rgba(29, 103, 178, 0.2); border-radius: 9px;
  padding: 0 12px 0 32px; font: inherit; font-size: 14px; color: #16365c; outline: 0; background: #fbfdff;
}
.tc-search-field input:focus { border-color: #1d67b2; background: #fff; box-shadow: 0 0 0 3px rgba(29, 103, 178, 0.1); }
.tc-search select {
  height: 38px; width: 116px; border: 1px solid rgba(29, 103, 178, 0.2); border-radius: 9px;
  padding: 0 8px; font: inherit; font-size: 13.5px; color: #2b4f7d; background: #fff; outline: 0;
}
.tc-find {
  height: 38px; padding: 0 16px; border: 0; border-radius: 9px; background: #1d67b2; color: #fff;
  font: inherit; font-size: 14.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap; flex: 0 0 auto; cursor: pointer; box-shadow: 0 6px 14px rgba(29, 103, 178, 0.22);
}
.tc-find:hover { filter: brightness(1.06); }

/* ---------- 结果行 ---------- */
.tc-result {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 2px 0 12px; font-size: 12.5px; color: #6b81a0;
}
.tc-result b { color: #16365c; font-size: 14px; }
.tc-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  background: #eaf2fc; color: #1d67b2; padding: 4px 8px 4px 10px; border-radius: 999px;
}
.tc-chip button { border: 0; background: transparent; color: currentColor; font-size: 13px; line-height: 1; padding: 0; opacity: 0.7; cursor: pointer; }
.tc-chip button:hover { opacity: 1; }
.tc-clear-all { border: 0; background: transparent; color: #1d67b2; font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- 卡片 ---------- */
.tc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (min-width: 2000px) {
  .tc-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 2400px) {
  .tc-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.tc-card {
  display: flex; flex-direction: column; background: #fff;
  border: 1px solid rgba(29, 103, 178, 0.12); border-radius: 14px; padding: 14px 15px 12px;
  box-shadow: 0 2px 8px rgba(21, 52, 92, 0.05); cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.tc-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(21, 52, 92, 0.1); border-color: rgba(29, 103, 178, 0.26); }
.tc-card-main { display: flex; gap: 12px; align-items: flex-start; }
.tc-card-body { min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.tc-card-body h3 {
  margin: 0; font-size: 15px; line-height: 1.4; font-weight: 600; letter-spacing: -0.1px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tc-star {
  flex: 0 0 auto; border: 0; background: transparent; color: #c3d1e2;
  font-size: 16px; line-height: 1; padding: 2px; cursor: pointer;
}
.tc-star:hover { color: #f0a531; }
.tc-star.is-on { color: #f0a531; }
.tc-thumb {
  width: 88px; height: 88px; flex: 0 0 88px; margin: 2px 0 0; border-radius: 12px; overflow: hidden;
  background: linear-gradient(180deg, #fbfdff, #f6faff);
  border: 1px solid rgba(29, 103, 178, 0.07); display: grid; place-items: center;
}
.tc-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; display: block; }
.tc-thumb.is-empty {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d67b2' stroke-opacity='0.3' stroke-width='1.4' stroke-linecap='round'%3E%3Cpath d='M4 20V10M10 20V4M16 20v-7M22 20H2'/%3E%3C/svg%3E");
  background-size: 34px 34px; background-position: center; background-repeat: no-repeat;
}
.tc-desc {
  margin: 0; font-size: 12.5px; line-height: 1.55; color: #6b81a0; min-height: 38px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tc-card-foot {
  margin-top: auto; padding-top: 11px; display: flex; align-items: center; gap: 8px;
  border-top: 1px dashed rgba(29, 103, 178, 0.1);
}
.tc-cat { font-size: 11.5px; color: #5b7799; background: #f3f7fc; border-radius: 6px; padding: 2px 7px; }
.tc-tier { font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.tc-tier.is-free { color: #0f9967; background: #e9f7ef; }
.tc-tier.is-member { color: #9a6a00; background: #fdf3dd; }
.tc-uses { font-size: 11.5px; color: #8ba0bb; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.tc-card-foot .tc-star { margin-left: 2px; }

.tc-ai {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 14px;
  border: 1px dashed rgba(29, 103, 178, 0.3);
  background: linear-gradient(120deg, #fbfdff, #eef6fe 60%, #eaf7f5);
  padding: 15px 18px; border-radius: 14px; cursor: pointer; text-align: left;
}
.tc-ai:hover { border-color: #1d67b2; box-shadow: 0 16px 34px rgba(21, 52, 92, 0.1); }
.tc-ai-badge {
  font-size: 11px; font-weight: 600; color: #1d67b2; background: #fff;
  border: 1px solid rgba(29, 103, 178, 0.16); padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}
.tc-ai h3 { margin: 0 0 3px; font-size: 14.5px; }
.tc-ai p { margin: 0; font-size: 12.5px; color: #6b81a0; }
.tc-ai .tc-ai-go { margin-left: auto; font-size: 12.5px; font-weight: 600; color: #1d67b2; white-space: nowrap; }

.tc-empty {
  grid-column: 1 / -1; background: #fff; border: 1px dashed rgba(29, 103, 178, 0.2);
  border-radius: 14px; padding: 46px 20px; text-align: center; color: #6b81a0;
}
.tc-empty strong { display: block; color: #16365c; font-size: 15px; margin-bottom: 6px; }

.tc-pager { display: flex; justify-content: center; margin: 26px 0 8px; }
.tc-pager:empty { display: none; }
.tc-pager-box {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center;
  background: #fff; border: 1px solid rgba(29, 103, 178, 0.16); border-radius: 12px;
  padding: 8px 14px; box-shadow: 0 2px 8px rgba(21, 52, 92, 0.05);
}
.tc-pager-total { font-size: 13px; color: #6b81a0; margin-right: 10px; }
.tc-page-btn {
  min-width: 34px; height: 34px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: #2b4f7d; font: inherit; font-size: 13.5px; cursor: pointer;
  font-variant-numeric: tabular-nums; transition: background 0.14s ease, color 0.14s ease;
}
.tc-page-btn:hover:not(:disabled) { background: #eef5fc; color: #1d67b2; }
.tc-page-btn.is-active { background: #1d67b2; color: #fff; font-weight: 600; }
.tc-page-btn:disabled { color: #c3d1e2; cursor: default; }
.tc-page-btn.tc-page-nav { color: #2b4f7d; }
.tc-page-btn.tc-page-nav:disabled { color: #c3d1e2; }
.tc-page-gap { color: #8ba0bb; padding: 0 2px; user-select: none; }

.tc-skeleton { height: 260px; border-radius: 14px; background: linear-gradient(100deg, #f6f9fd 30%, #eef4fb 50%, #f6f9fd 70%); background-size: 200% 100%; animation: tc-shimmer 1.2s infinite linear; }
@keyframes tc-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (max-width: 1520px) {
  .tc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tc-thumb { width: 80px; height: 80px; flex-basis: 80px; }
  .tc-tab { padding: 8px 9px; font-size: 15px; }
  .tc-sort { padding: 8px 7px; font-size: 14.5px; }
  .tc-sorts { padding-left: 6px; }
  .tc-search select { width: 94px; }
}
@media (max-width: 1180px) {
  /* 窄屏：工具栏换行，避免 nowrap 把整列撑宽导致横向滚动 */
  .tc-toolbar { flex-wrap: wrap; row-gap: 8px; }
  .tc-search { width: 100%; flex: 1 1 100%; }
  .tc-search-field { max-width: none; }
}

@media (max-width: 1080px) {
  .tc-layout { grid-template-columns: 1fr; }
  .tc-layout > * { min-width: 0; }
  .tc-side { position: static; }
  .tc-hero-stats { display: none; }
  .tc-toolbar-wrap { position: static; }
}
@media (max-width: 900px) {
  .dashboard-page-tools-hub .dashboard-topbar { position: static; }
}

@media (max-width: 820px) {
  .tc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tc-page { padding: 16px 16px 48px; }
}
@media (max-width: 620px) {
  .tc-grid { grid-template-columns: 1fr; }
}
