/* ============================================================
   components.css — TWC 统一组件类
   依赖 common.css 的 tokens。类名统一 twc- 前缀，避免与 Tailwind 冲突。
   ============================================================ */

/* ---------- 布局容器 ---------- */
.twc-container {
  width: 100%;
  max-width: var(--twc-container);
  margin: 0 auto;
  padding-left: var(--twc-container-pad);
  padding-right: var(--twc-container-pad);
}
.twc-page { min-height: 100vh; display: flex; flex-direction: column; }
.twc-main { flex: 1; min-width: 0; }

/* ---------- 分区 ---------- */
.twc-section { padding: var(--twc-space-7) 0; }
.twc-section--tight { padding: 40px 0; }
.twc-section--alt { background: var(--twc-surface); }
.twc-section--bg { background: var(--twc-bg-alt); }

/* ---------- eyebrow / 标签行 ---------- */
.twc-eyebrow {
  display: inline-flex; align-items: center; gap: var(--twc-space-2);
  font-size: var(--twc-text-xs); font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--twc-muted);
}
.twc-eyebrow-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--twc-accent); display: inline-block;
}

/* ---------- 标题 ---------- */
.twc-h1 {
  font-size: var(--twc-text-3xl); font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.1;
  color: var(--twc-ink); margin: 0;
}
.twc-h2 {
  font-size: var(--twc-text-2xl); font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.2;
  color: var(--twc-ink); margin: 0;
}
.twc-h3 {
  font-size: var(--twc-text-lg); font-weight: 700;
  letter-spacing: -0.01em; color: var(--twc-ink); margin: 0;
}
.twc-lede {
  font-size: var(--twc-text-md); color: var(--twc-text);
  line-height: 1.7; margin: 0;
}

/* ---------- 分区标题(带编号图标) ---------- */
.twc-section-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 26px;
}
.twc-section-head__icon {
  width: 28px; height: 28px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.twc-section-head__title { font-size: var(--twc-text-xl); font-weight: 600; letter-spacing: -0.01em; color: var(--twc-ink); }
.twc-section-head__sub { font-size: var(--twc-text-sm); color: var(--twc-muted); margin-top: 6px; }
.twc-section-head__count {
  margin-left: auto; font-size: var(--twc-text-xs); font-weight: 500;
  color: var(--twc-muted); background: var(--twc-bg-alt);
  border: var(--twc-border); border-radius: var(--twc-radius-full);
  padding: 2px 10px;
}

/* ---------- 面包屑 ---------- */
.twc-breadcrumb {
  display: flex; align-items: center; gap: var(--twc-space-2);
  font-size: var(--twc-text-xs); color: var(--twc-muted);
  flex-wrap: wrap;
}
.twc-breadcrumb a { text-decoration: none; color: var(--twc-muted); transition: color var(--twc-dur); }
.twc-breadcrumb a:hover { color: var(--twc-accent); }
.twc-breadcrumb__sep { color: var(--twc-faint); }
.twc-breadcrumb__current { color: var(--twc-ink); font-weight: 500; }

/* ---------- 按钮 ---------- */
.twc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--twc-space-2);
  padding: 9px 18px; border-radius: var(--twc-radius-sm);
  font-family: inherit; font-size: var(--twc-text-base); font-weight: 600;
  line-height: 1.2; cursor: pointer; text-decoration: none;
  border: 1px solid transparent; white-space: nowrap;
  transition: background var(--twc-dur), border-color var(--twc-dur),
    color var(--twc-dur), box-shadow var(--twc-dur), transform var(--twc-dur);
}
.twc-btn:active { transform: translateY(1px); }
.twc-btn--primary { background: var(--twc-ink); color: #fff; }
.twc-btn--primary:hover { background: var(--twc-ink-soft); }
.twc-btn--accent { background: var(--twc-accent); color: #fff; }
.twc-btn--accent:hover { background: var(--twc-accent-strong); }
.twc-btn--ghost { background: var(--twc-surface); color: var(--twc-text); border-color: var(--twc-line); }
.twc-btn--ghost:hover { border-color: var(--twc-faint); background: var(--twc-bg); color: var(--twc-ink); }
.twc-btn--sm { padding: 6px 12px; font-size: var(--twc-text-sm); }
.twc-btn--lg { padding: 12px 24px; font-size: var(--twc-text-md); }
.twc-btn--block { width: 100%; }

/* ---------- 输入框 ---------- */
.twc-input, .twc-textarea, .twc-select {
  width: 100%; font-family: inherit; font-size: var(--twc-text-base);
  color: var(--twc-ink); background: var(--twc-surface);
  border: 1px solid var(--twc-line); border-radius: var(--twc-radius-sm);
  padding: 9px 12px; outline: none;
  transition: border-color var(--twc-dur), box-shadow var(--twc-dur);
}
.twc-textarea { resize: vertical; min-height: 84px; }
.twc-input:focus, .twc-textarea:focus, .twc-select:focus {
  border-color: var(--twc-accent); box-shadow: var(--twc-ring);
}
.twc-input::placeholder, .twc-textarea::placeholder { color: var(--twc-faint); }

/* 带图标的搜索框 */
.twc-search { position: relative; }
.twc-search > svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--twc-faint); pointer-events: none;
}
.twc-search > input {
  width: 100%; height: 44px;
  border: 1px solid var(--twc-line); border-radius: var(--twc-radius-md);
  background: var(--twc-surface); padding: 0 14px 0 42px;
  font-family: inherit; font-size: var(--twc-text-base); color: var(--twc-ink);
  outline: none; box-shadow: var(--twc-shadow-sm);
  transition: border-color var(--twc-dur), box-shadow var(--twc-dur);
}
.twc-search > input::placeholder { color: var(--twc-faint); }
.twc-search > input:focus { border-color: var(--twc-accent); box-shadow: var(--twc-ring); }

/* ---------- Badge ---------- */
.twc-badge {
  display: inline-flex; align-items: center; border-radius: var(--twc-radius-full);
  padding: 2px 9px; font-size: var(--twc-text-xs); font-weight: 600;
  line-height: 1.7; letter-spacing: 0.02em; white-space: nowrap;
}
.twc-badge--new { background: var(--twc-new-bg); color: var(--twc-new-fg); }
.twc-badge--hot { background: var(--twc-hot-bg); color: var(--twc-hot-fg); }

/* ---------- Pill(特性标签) ---------- */
.twc-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; background: var(--twc-surface);
  border: 1px solid var(--twc-line); border-radius: var(--twc-radius-full);
  font-size: var(--twc-text-xs); font-weight: 500; color: var(--twc-muted);
}
.twc-pill-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--twc-accent); }
.twc-pill-dot--warn { background: #f59e0b; }

/* ---------- 卡片 ---------- */
.twc-card {
  background: var(--twc-surface); border: 1px solid var(--twc-card-line);
  border-radius: var(--twc-radius-lg); overflow: hidden;
}
.twc-card--pad { padding: var(--twc-space-5); }

/* ---------- 工具卡片 ---------- */
/* 卡片：图标 + 名称同一行，简介在下，底部操作条 */
.twc-tool-card {
  position: relative; display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  grid-template-areas: "icon name badges" "desc desc desc" "foot foot foot";
  grid-template-rows: auto 1fr auto;
  column-gap: 16px;
  padding: 26px 26px 20px; border-radius: var(--twc-radius-lg);
  border: 1px solid var(--twc-card-line); background: var(--twc-surface);
  text-decoration: none; color: inherit; cursor: pointer; overflow: hidden;
  min-height: 176px;
  transition: border-color var(--twc-dur), box-shadow var(--twc-dur), transform var(--twc-dur);
}
.twc-tool-card::before { content: none; }
/* NEW 角标：左上角斜切缎带，仅悬停时显示 */
.twc-tool-card--new::after {
  content: "NEW";
  position: absolute; top: 8px; left: -38px; width: 100px; padding: 3px 0;
  transform: rotate(-45deg);
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff; font-size: 10px; font-weight: 700; line-height: 1.5;
  letter-spacing: 0.14em; text-align: center;
  box-shadow: 0 1px 3px rgba(9, 9, 11, 0.12);
  opacity: 0; pointer-events: none; z-index: 3;
  transition: opacity var(--twc-dur);
}
.twc-tool-card--new:hover::after { opacity: 1; }
.twc-tool-card:hover {
  border-color: var(--twc-accent-line);
  box-shadow: var(--twc-shadow-md); transform: translateY(-2px);
}
.twc-tool-card__top { display: contents; }
.twc-tool-card__icon {
  grid-area: icon; align-self: center;
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: var(--twc-radius-md);
  background: var(--twc-bg); border: 1px solid var(--twc-line-soft);
  display: flex; align-items: center; justify-content: center; font-size: 21px;
}
.twc-tool-card__badges { grid-area: badges; align-self: start; display: flex; gap: 4px; align-items: center; justify-content: flex-end; margin: -4px -6px 0 0; }
/* 工具卡片：标题 + 模式标签与图标同高，取消底部信息栏 */
.twc-tool-card--tool {
  grid-template-areas: "icon meta badges" "desc desc desc";
  grid-template-rows: 44px auto;
  min-height: 0;
}
.twc-tool-card__meta {
  grid-area: meta; min-width: 0; height: 44px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px;
}
.twc-tool-card--tool .twc-tool-card__name {
  display: block; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.35;
}
.twc-tool-card--tool .twc-mode-tag {
  font-size: var(--twc-text-sm); color: var(--twc-faint); line-height: 1.3; gap: 3px;
}
.twc-tool-card--tool .twc-mode-tag::before { width: 5px; height: 5px; }
.twc-tool-card--tool .twc-tool-card__desc { margin-top: 16px; min-height: 44px; }
.twc-tool-card__name {
  grid-area: name; align-self: center;
  font-size: 16px; font-weight: 600; color: var(--twc-ink);
  line-height: 1.45; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.twc-tool-card__desc {
  grid-area: desc;
  font-size: var(--twc-text-sm); color: var(--twc-muted); line-height: 1.7;
  margin: 16px 0 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.twc-tool-card__foot {
  grid-area: foot;
  display: flex; align-items: center; gap: 6px;
  margin-top: 16px; padding-top: 14px; min-height: 40px;
  border-top: 1px solid var(--twc-line-soft);
}
.twc-tool-card__tag {
  display: inline-block; font-size: var(--twc-text-sm); color: var(--twc-muted);
  background: var(--twc-bg); border: 1px solid var(--twc-line-soft);
  border-radius: var(--twc-radius-full); padding: 3px 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}

/* ---------- 网格 ---------- */
.twc-grid { display: grid; gap: 24px; }
/* 卡片网格：桌面固定 4 列，逐级降到 3 / 2 / 1 列 */
.twc-grid--tools { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1240px) { .twc-grid--tools { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 960px)  { .twc-grid--tools { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }
@media (max-width: 560px)  { .twc-grid--tools { grid-template-columns: 1fr; } }
.twc-grid--auto { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* ---------- FAQ ---------- */
.twc-faq-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px; background: var(--twc-line);
  border: var(--twc-border); border-radius: var(--twc-radius-lg); overflow: hidden;
}
.twc-faq-item { background: var(--twc-surface); }
.twc-faq-trigger {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--twc-space-3);
  width: 100%; padding: 16px 18px; background: none; border: none;
  font-family: inherit; font-size: var(--twc-text-sm); font-weight: 500;
  color: var(--twc-ink); cursor: pointer; text-align: left; line-height: 1.5;
  transition: background var(--twc-dur);
}
.twc-faq-trigger:hover { background: var(--twc-bg); }
.twc-faq-chevron { flex-shrink: 0; color: var(--twc-faint); margin-top: 2px; transition: transform 0.2s var(--twc-ease); }
.twc-faq-trigger[aria-expanded="true"] .twc-faq-chevron { transform: rotate(180deg); }
.twc-faq-body { display: none; padding: 0 18px 16px; font-size: var(--twc-text-sm); color: var(--twc-text); line-height: 1.75; }
.twc-faq-body.twc-open { display: block; }

/* ---------- 特性卡 ---------- */
.twc-feature-card {
  padding: 22px; border-radius: var(--twc-radius-md);
  border: var(--twc-border); background: var(--twc-bg);
  transition: border-color var(--twc-dur);
}
.twc-feature-card:hover { border-color: var(--twc-faint); }
.twc-feature-card__icon {
  width: 34px; height: 34px; border-radius: var(--twc-radius-sm);
  background: var(--twc-surface); border: var(--twc-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; margin-bottom: 12px;
}
.twc-feature-card__title { font-size: var(--twc-text-base); font-weight: 600; margin-bottom: 6px; color: var(--twc-ink); }
.twc-feature-card__desc { font-size: var(--twc-text-sm); color: var(--twc-muted); line-height: 1.7; }

/* ---------- 空状态 ---------- */
.twc-empty {
  grid-column: 1 / -1; display: flex; flex-direction: column;
  align-items: center; gap: var(--twc-space-2); padding: 48px 24px;
  color: var(--twc-faint); text-align: center;
}
.twc-empty__icon { font-size: 32px; }

/* ---------- 分隔线 ---------- */
.twc-divider { height: 1px; background: var(--twc-line); border: 0; margin: 0; }

/* ---------- 回到顶部 ---------- */
.twc-back-to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  width: 40px; height: 40px; border-radius: var(--twc-radius-full);
  background: var(--twc-surface); border: var(--twc-border);
  box-shadow: var(--twc-shadow-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--twc-muted); text-decoration: none;
  transition: color var(--twc-dur), border-color var(--twc-dur), transform var(--twc-dur);
}
.twc-back-to-top:hover { color: var(--twc-accent); border-color: var(--twc-accent-line); transform: translateY(-2px); }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .twc-faq-grid { grid-template-columns: 1fr; }
}

/* ---------- 卡片 Hover 双轨交互：收藏 + 直达网站/直接下载 ---------- */
.twc-tool-card:focus-visible { outline: none; border-color: var(--twc-accent); box-shadow: var(--twc-ring); }
.twc-tool-card__icon img { width: 20px; height: 20px; object-fit: contain; }
.twc-tool-card__name { text-decoration: none; display: block; }
.twc-tool-card__name:hover { color: var(--twc-accent-strong); }

.twc-fav-btn {
  width: 30px; height: 30px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; border-radius: var(--twc-radius-sm);
  color: var(--twc-faint); font-size: 18px; line-height: 1; cursor: pointer;
  transition: color var(--twc-dur), background var(--twc-dur);
}
.twc-fav-btn:hover { background: var(--twc-bg-alt); color: var(--twc-accent); }
.twc-fav-btn.twc-is-fav { color: var(--twc-accent); }

.twc-card-direct-btn {
  margin-left: auto; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: var(--twc-radius-sm);
  background: var(--twc-accent); color: #fff; text-decoration: none;
  font-size: var(--twc-text-sm); font-weight: 600; line-height: 1.6; white-space: nowrap;
  opacity: 0; transform: translateY(4px); pointer-events: none;
  transition: opacity var(--twc-dur), transform var(--twc-dur), background var(--twc-dur);
}
.twc-card-direct-btn:hover { background: var(--twc-accent-strong); }
.twc-tool-card:hover .twc-card-direct-btn,
.twc-tool-card:focus-within .twc-card-direct-btn { opacity: 1; transform: none; pointer-events: auto; }
@media (hover: none) {
  .twc-card-direct-btn { opacity: 1; transform: none; pointer-events: auto; }
}

.twc-mode-tag { font-size: var(--twc-text-sm); color: var(--twc-muted); display: inline-flex; align-items: center; gap: 4px; }
.twc-mode-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--twc-new-fg); }
.twc-mode-tag--api::before { background: #f59e0b; }

/* ---------- 楼层（首页 / 列表页分类区块） ---------- */
.twc-floor { margin-bottom: 56px; }
.twc-floor__sub { margin-bottom: 36px; }
.twc-floor__subhead {
  display: flex; align-items: center; gap: var(--twc-space-2);
  font-size: 17px; font-weight: 400; color: var(--twc-ink);
  margin: 0 0 16px;
}
.twc-floor__subhead small { font-size: var(--twc-text-sm); font-weight: 400; color: var(--twc-muted); }
.twc-floor__more { margin-left: auto; font-size: var(--twc-text-sm); font-weight: 500; color: var(--twc-muted); text-decoration: none; }
.twc-floor__more:hover { color: var(--twc-accent); }

/* ---------- 迷你链接列表（内页右栏推荐） ---------- */
.twc-mini-link {
  display: flex; align-items: center; gap: var(--twc-space-3);
  padding: 8px 10px; border-radius: var(--twc-radius-sm);
  border: 1px solid var(--twc-line-soft); background: var(--twc-surface);
  text-decoration: none; color: var(--twc-text);
  transition: border-color var(--twc-dur), background var(--twc-dur);
}
.twc-mini-link:hover { border-color: var(--twc-accent-line); background: var(--twc-accent-soft); }
.twc-mini-link__icon {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: var(--twc-radius-sm);
  background: var(--twc-bg-alt); border: var(--twc-border);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.twc-mini-link__icon img { width: 18px; height: 18px; object-fit: contain; }
.twc-mini-link__name { font-size: var(--twc-text-sm); font-weight: 600; color: var(--twc-ink); line-height: 1.35; }
.twc-mini-link__desc { font-size: var(--twc-text-xs); color: var(--twc-muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Toast ---------- */
.twc-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 300;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: var(--twc-ink); color: #fff; border-radius: var(--twc-radius-sm);
  padding: 8px 16px; font-size: var(--twc-text-sm); box-shadow: var(--twc-shadow-md);
  transition: opacity var(--twc-dur), transform var(--twc-dur);
}
.twc-toast.twc-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 首页：Hero / 我的工具 / 最近使用 ---------- */
.twc-home-hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(ellipse 60% 120% at 100% 0%, rgba(37, 99, 235, 0.08), transparent 60%),
    linear-gradient(180deg, var(--twc-surface), var(--twc-surface));
  border: var(--twc-border); border-radius: var(--twc-radius-lg);
  padding: 32px;
  margin-bottom: 48px;
}
.twc-home-hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--twc-line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--twc-line-soft) 1px, transparent 1px);
  background-size: 28px 28px; opacity: 0.55;
  -webkit-mask-image: linear-gradient(90deg, transparent 40%, #000);
          mask-image: linear-gradient(90deg, transparent 40%, #000);
}
.twc-home-hero > * { position: relative; z-index: 1; }
.twc-home-hero__title { font-size: clamp(26px, 3vw, 34px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; color: var(--twc-ink); margin: 0 0 6px; }
.twc-home-hero__desc { font-size: var(--twc-text-md); line-height: 1.75; color: var(--twc-muted); margin: 0 0 20px; max-width: 720px; }
.twc-home-hero__pills { display: flex; flex-wrap: wrap; gap: var(--twc-space-2); }

.twc-drag-handle { cursor: grab; color: var(--twc-muted); font-size: 14px; padding: 0 2px; user-select: none; }
.twc-drag-handle:active { cursor: grabbing; }
.twc-sortable-ghost { opacity: 0.4; border-style: dashed; }

.twc-chip-row { display: flex; flex-wrap: wrap; gap: var(--twc-space-2); }
.twc-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px 5px 6px; border: var(--twc-border); border-radius: var(--twc-radius-full);
  background: var(--twc-surface); font-size: var(--twc-text-sm); color: var(--twc-text); text-decoration: none;
  transition: border-color var(--twc-dur), color var(--twc-dur);
}
.twc-chip:hover { border-color: var(--twc-accent-line); color: var(--twc-accent-strong); }
.twc-chip__icon { width: 22px; height: 22px; border-radius: var(--twc-radius-full); background: var(--twc-bg-alt); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.twc-chip__icon img { width: 14px; height: 14px; object-fit: contain; }

@media (prefers-reduced-motion: no-preference) {
  .twc-floor, .twc-home-hero { animation: twc-rise 0.42s var(--twc-ease) both; }
  .twc-floor:nth-of-type(2) { animation-delay: 0.05s; }
  .twc-floor:nth-of-type(3) { animation-delay: 0.1s; }
  .twc-floor:nth-of-type(4) { animation-delay: 0.15s; }
}
@keyframes twc-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 文档型页面（关于/隐私/MCP） ---------- */
.twc-prose { max-width: 860px; font-size: var(--twc-text-base); color: var(--twc-text); line-height: 1.75; }
.twc-prose h2 { font-size: var(--twc-text-lg); font-weight: 700; color: var(--twc-ink); margin: var(--twc-space-5) 0 var(--twc-space-2); }
.twc-prose h3 { font-size: var(--twc-text-md); font-weight: 600; color: var(--twc-ink); margin: var(--twc-space-4) 0 var(--twc-space-2); }
.twc-prose p, .twc-prose ul, .twc-prose ol { margin: 0 0 var(--twc-space-3); }
.twc-prose ul, .twc-prose ol { padding-left: 1.3em; }
.twc-prose a { color: var(--twc-accent); }
.twc-prose code { font-family: var(--twc-font-mono); font-size: 13px; background: var(--twc-bg-alt); border: 1px solid var(--twc-line); border-radius: 4px; padding: 0 5px; }
.twc-code {
  font-family: var(--twc-font-mono); font-size: 13px; line-height: 1.6; color: var(--twc-ink);
  background: var(--twc-bg-alt); border: var(--twc-border); border-radius: var(--twc-radius-md);
  padding: var(--twc-space-4); overflow-x: auto; white-space: pre; margin: 0 0 var(--twc-space-3);
}
.twc-table { width: 100%; border-collapse: collapse; font-size: var(--twc-text-sm); margin: 0 0 var(--twc-space-4); }
.twc-table th, .twc-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--twc-line); vertical-align: top; }
.twc-table th { background: var(--twc-bg-alt); font-weight: 600; color: var(--twc-ink); }

/* ---------- 排行榜（默认折叠的 <details>） ---------- */
.twc-rank-floor { border: 1px solid var(--twc-card-line); border-radius: var(--twc-radius-lg); background: var(--twc-surface); padding: 0 24px; }
.twc-rank-floor[open] { padding-bottom: 24px; }
.twc-rank-summary { list-style: none; cursor: pointer; margin: 0; padding: 20px 0; user-select: none; }
.twc-rank-summary::-webkit-details-marker { display: none; }
.twc-rank-summary:focus-visible { outline: none; box-shadow: var(--twc-ring); border-radius: var(--twc-radius-md); }
.twc-rank-chevron { margin-left: auto; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--twc-radius-sm); color: var(--twc-muted); font-size: 16px; transition: transform 0.2s var(--twc-ease), background var(--twc-dur); }
.twc-rank-summary:hover .twc-rank-chevron { background: var(--twc-bg-alt); color: var(--twc-ink); }
.twc-rank-floor[open] .twc-rank-chevron { transform: rotate(180deg); }
.twc-rank-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.twc-rank { border: 1px solid var(--twc-line-soft); border-radius: var(--twc-radius-md); background: var(--twc-bg); padding: 16px 16px 10px; }
.twc-rank__title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 400; color: var(--twc-ink); margin: 0 0 10px; }
.twc-rank__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.twc-rank__link { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--twc-radius-sm); text-decoration: none; color: inherit; transition: background var(--twc-dur); }
.twc-rank__link:hover { background: var(--twc-surface); box-shadow: var(--twc-shadow-sm); }
.twc-rank__no { width: 24px; flex-shrink: 0; text-align: center; font-family: var(--twc-font-mono); font-size: 15px; font-weight: 400; color: var(--twc-muted); }
.twc-rank__no--top { color: var(--twc-accent); }
.twc-rank__icon { width: 36px; height: 36px; flex-shrink: 0; border-radius: var(--twc-radius-sm); background: var(--twc-surface); border: var(--twc-border); display: flex; align-items: center; justify-content: center; font-size: 17px; }
.twc-rank__icon img { width: 20px; height: 20px; object-fit: contain; }
.twc-rank__main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.twc-rank__name { font-size: 15px; font-weight: 400; color: var(--twc-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.twc-rank__desc { font-size: var(--twc-text-sm); color: var(--twc-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.twc-rank__sec { flex-shrink: 0; font-size: var(--twc-text-xs); color: var(--twc-muted); background: var(--twc-surface); border: 1px solid var(--twc-line); border-radius: var(--twc-radius-full); padding: 2px 10px; }
@media (max-width: 960px) { .twc-rank-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .twc-rank-floor { padding: 0 16px; } .twc-rank__sec { display: none; } }
/* ============================================================
   首页首屏（参考：数据卡 | 轮播 Banner | 最新发布 三栏）
   ============================================================ */
.twc-slogan { font-size: 16px; color: var(--twc-text); margin: 0 0 18px; }
.twc-hero-row {
  display: grid; gap: 20px; margin-bottom: 40px;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr) minmax(240px, 1fr);
  grid-template-areas: "stats banner latest";
}
.twc-hero-stats { grid-area: stats; display: grid; grid-template-rows: 1fr 1fr; gap: 20px; }
.twc-stat {
  display: flex; align-items: center; gap: 18px;
  background: var(--twc-surface); border: 1px solid var(--twc-card-line); border-radius: var(--twc-radius-lg);
  padding: 20px 24px;
}
.twc-stat__icon {
  width: 52px; height: 52px; flex-shrink: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #e6efff; color: var(--twc-accent);
}
.twc-stat__icon--alt { background: #e7f7ef; color: #16a34a; }
.twc-stat__num { font-size: 24px; font-weight: 600; color: var(--twc-ink); line-height: 1.2; font-variant-numeric: tabular-nums; }
.twc-stat__label { font-size: var(--twc-text-sm); color: var(--twc-muted); margin-top: 2px; }

.twc-banner { grid-area: banner; position: relative; border-radius: var(--twc-radius-lg); overflow: hidden; min-height: 218px; isolation: isolate; }
.twc-banner__track { position: absolute; inset: 0; }
.twc-banner__slide {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 24px clamp(24px, 4vw, 56px); color: #fff;
  opacity: 0; visibility: hidden; transition: opacity 0.5s var(--twc-ease), visibility 0.5s;
}
.twc-banner__slide.is-active { opacity: 1; visibility: visible; }
.twc-banner__slide--a { background: linear-gradient(110deg, #3b82f6 0%, #4338ca 48%, #b45392 100%); }
.twc-banner__slide--b { background: linear-gradient(110deg, #0ea5e9 0%, #2563eb 55%, #1e3a8a 100%); }
.twc-banner__slide--c { background: linear-gradient(110deg, #0f766e 0%, #2563eb 60%, #6d28d9 100%); }
.twc-banner__copy h2 { font-size: clamp(22px, 2.3vw, 32px); font-weight: 800; line-height: 1.3; letter-spacing: 0.02em; margin: 0 0 10px; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.15); }
.twc-banner__copy p { font-size: 15px; opacity: 0.92; margin: 0 0 16px; }
.twc-banner__btn {
  display: inline-flex; align-items: center; padding: 7px 16px; border-radius: var(--twc-radius-full);
  background: rgba(255, 255, 255, 0.18); border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff; font-size: var(--twc-text-sm); font-weight: 600; text-decoration: none;
  transition: background var(--twc-dur);
}
.twc-banner__btn:hover { background: rgba(255, 255, 255, 0.3); }
/* 右侧装饰：一块"屏幕"里的应用图标网格 */
.twc-banner__art {
  flex-shrink: 0; width: 190px; aspect-ratio: 16 / 11; border-radius: 12px; padding: 16px;
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.45);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.twc-banner__art span { border-radius: 9px; background: rgba(255, 255, 255, 0.85); }
.twc-banner__art span:nth-child(2) { background: #fde68a; }
.twc-banner__art span:nth-child(4) { background: #bbf7d0; }
.twc-banner__art span:nth-child(6) { background: #fbcfe8; }
.twc-banner__nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 32px; height: 32px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255, 255, 255, 0.28); color: #fff; font-size: 20px; line-height: 1;
  opacity: 0; transition: opacity var(--twc-dur), background var(--twc-dur);
}
.twc-banner__nav--prev { left: 12px; } .twc-banner__nav--next { right: 12px; }
.twc-banner:hover .twc-banner__nav, .twc-banner__nav:focus-visible { opacity: 1; }
.twc-banner__nav:hover { background: rgba(255, 255, 255, 0.45); }
.twc-banner__dots { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 6px; z-index: 2; }
.twc-banner__dots button { width: 22px; height: 3px; padding: 0; border: none; border-radius: 2px; background: rgba(255, 255, 255, 0.45); cursor: pointer; transition: background var(--twc-dur), width var(--twc-dur); }
.twc-banner__dots button.is-active { background: #fff; width: 30px; }

.twc-latest { grid-area: latest; background: var(--twc-surface); border: 1px solid var(--twc-card-line); border-radius: var(--twc-radius-lg); padding: 20px 20px 12px; }
.twc-latest__title { font-size: 16px; font-weight: 400; color: var(--twc-ink); margin: 0 0 10px; }
.twc-latest__item { display: flex; align-items: center; gap: 12px; padding: 8px; margin: 0 -8px; border-radius: var(--twc-radius-sm); text-decoration: none; color: inherit; transition: background var(--twc-dur); }
.twc-latest__item:hover { background: var(--twc-bg); }
.twc-latest__icon { width: 36px; height: 36px; flex-shrink: 0; border-radius: var(--twc-radius-sm); background: var(--twc-bg); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.twc-latest__icon img { width: 20px; height: 20px; object-fit: contain; }
.twc-latest__main { min-width: 0; display: flex; flex-direction: column; }
.twc-latest__name { font-size: var(--twc-text-sm); font-weight: 500; color: var(--twc-ink); }
.twc-latest__desc { font-size: var(--twc-text-xs); color: var(--twc-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 「我的工具」空态：参考站的"添加工具 +"大白卡 */
.twc-slot-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 128px; border: 1px solid var(--twc-card-line); border-radius: var(--twc-radius-lg);
  background: var(--twc-surface); color: var(--twc-text); text-decoration: none; padding: 20px;
  transition: border-color var(--twc-dur), box-shadow var(--twc-dur);
}
.twc-slot-empty:hover { border-color: var(--twc-accent-line); box-shadow: var(--twc-shadow-md); }
.twc-slot-empty__label { font-size: 15px; }
.twc-slot-empty__plus { font-size: 34px; font-weight: 200; line-height: 1; color: var(--twc-muted); }
.twc-slot-empty:hover .twc-slot-empty__plus { color: var(--twc-accent); }

@media (max-width: 1240px) {
  .twc-hero-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "banner banner" "stats latest"; }
}
@media (max-width: 700px) {
  .twc-hero-row { grid-template-columns: 1fr; grid-template-areas: "banner" "stats" "latest"; }
  .twc-banner__art { display: none; }
}
@media (prefers-reduced-motion: reduce) { .twc-banner__slide { transition: none; } }
/* ============================================================
   工具工作台组件（模板 1 的 #tool-workbench 内部使用）
   ============================================================ */
.twc-wb-grid,
.twc-wb-split {
  display: grid;
  gap: 20px;
  align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.twc-panel__title { font-size: 16px; font-weight: 600; color: var(--twc-ink); margin: 0 0 10px; }
.twc-panel__hint { font-size: var(--twc-text-sm); color: var(--twc-muted); line-height: 1.65; margin: 0 0 12px; }
.twc-panel__hint code,
.twc-check code {
  font-family: var(--twc-font-mono);
  font-size: 12px;
  background: var(--twc-bg);
  border: 1px solid var(--twc-line);
  border-radius: 4px;
  padding: 0 4px;
}
.twc-wb-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 12px; }
.twc-wb-row--between { justify-content: space-between; align-items: center; }
.twc-wb-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--twc-text-sm);
  color: var(--twc-muted);
  flex: 1;
  min-width: 180px;
}
.twc-wb-tree,
.twc-wb-code { font-family: var(--twc-font-mono); font-size: 13px; line-height: 1.7; min-height: 190px; resize: vertical; }
.twc-wb-preview {
  border: var(--twc-border);
  border-radius: var(--twc-radius-md);
  background: var(--twc-bg);
  padding: 14px 16px;
  min-height: 120px;
  max-height: 300px;
  overflow-y: auto;
  font-size: var(--twc-text-sm);
}
.twc-wb-result {
  border: var(--twc-border);
  border-radius: var(--twc-radius-md);
  background: var(--twc-surface);
  padding: 8px 0;
  max-height: 460px;
  overflow: auto;
  margin-top: 10px;
}
.twc-wb-checks { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 12px; }
/* 窄字段（数字输入等）：限制最大宽度，避免单行输入框过空 */
.twc-wb-field--narrow { max-width: 220px; }
/* 复选框双列网格：选项多时比横向 wrap 更整齐 */
.twc-wb-checks--grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.twc-check--span { grid-column: 1 / -1; }
/* 工作台纵向节奏：相邻控件组之间留白 */
.twc-wb-field + .twc-wb-field,
.twc-wb-field + .twc-wb-checks,
.twc-wb-checks + .twc-wb-row,
.twc-wb-field + .twc-wb-row { margin-top: 16px; }
@media (max-width: 480px) { .twc-wb-checks--grid { grid-template-columns: 1fr; } }
.twc-wb-pw { display: flex; flex-direction: column; gap: 8px; }
.twc-pw-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: var(--twc-border);
  border-radius: var(--twc-radius-sm);
  background: var(--twc-bg);
  padding: 8px 8px 8px 14px;
}
.twc-pw { flex: 1; min-width: 0; font-family: var(--twc-font-mono); font-size: 15px; color: var(--twc-ink); word-break: break-all; }

/* 文本对比结果 */
.twc-diff-line {
  display: flex;
  gap: 10px;
  padding: 2px 16px;
  font-family: var(--twc-font-mono);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
}
.twc-diff-sign { width: 12px; flex-shrink: 0; color: var(--twc-faint); }
.twc-diff-add { background: #eefbf1; color: #14532d; }
.twc-diff-del { background: #fdf1f2; color: #7f1d1d; }

/* 拖拽上传区 */
.twc-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 150px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  border: 2px dashed #d4d4d8;
  border-radius: var(--twc-radius-md);
  background: var(--twc-bg);
  transition: border-color var(--twc-dur), background var(--twc-dur);
}
.twc-dropzone:hover,
.twc-dropzone--over { border-color: var(--twc-accent); background: var(--twc-accent-soft); }
.twc-dropzone:focus-visible { outline: none; box-shadow: var(--twc-ring); }
.twc-dropzone__big { font-size: 15px; color: var(--twc-text); }
.twc-dropzone__hint { font-size: var(--twc-text-xs); color: var(--twc-muted); }
.twc-hidden-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* 勾选项 */
.twc-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  font-size: var(--twc-text-sm);
  color: var(--twc-text);
  cursor: pointer;
  line-height: 1.6;
}
.twc-check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--twc-accent); flex-shrink: 0; }

/* 未上线工具的诚实占位 */
.twc-soon { text-align: center; padding: 40px 24px; }
.twc-soon__icon { font-size: 32px; margin-bottom: 12px; }

/* 分类页 chip 选中态与计数 */
.twc-chip--active { border-color: var(--twc-accent); background: var(--twc-accent-soft); color: var(--twc-accent-strong); }
.twc-chip__count { font-size: var(--twc-text-xs); color: var(--twc-faint); margin-left: 4px; }
.twc-chip--active .twc-chip__count { color: var(--twc-accent); }

/* 分类小节右上角的「分类列表 →」链接 */
.twc-floor__submore { margin-left: auto; font-size: var(--twc-text-sm); font-weight: 400; color: var(--twc-muted); text-decoration: none; white-space: nowrap; }
.twc-floor__submore:hover { color: var(--twc-accent); }
