/* ============================================================
   AI 工具箱 · 首页样式（v1.23.0 重构）
   定位：工具类企业官网首页。品牌页风格 + 移动端优先。
   复用 base.css 设计系统变量（--primary / --grad-main 等）。
   ============================================================ */

/* hidden 属性优先级最高：本页多处用 hidden 控制显隐，
   而 .tl-more/.tl-filter-chip 等类自带 display，会压过 UA 默认的 [hidden] 规则 */
[hidden]{display:none !important}

/* ---------------- Hero ---------------- */
.tl-hero{
  position:relative;overflow:hidden;
  padding:calc(var(--nav-h) + 40px) 20px 44px;
  background:radial-gradient(1000px 460px at 15% 0%,rgba(61,90,254,.16),transparent 62%),
             radial-gradient(860px 420px at 88% 8%,rgba(124,77,255,.14),transparent 62%),
             var(--grad-hero);
  text-align:center;
}
.tl-hero::before{
  content:'';position:absolute;inset:0;pointer-events:none;opacity:.5;
  background-image:linear-gradient(rgba(61,90,254,.055) 1px,transparent 1px),
                   linear-gradient(90deg,rgba(61,90,254,.055) 1px,transparent 1px);
  background-size:44px 44px;
  -webkit-mask-image:radial-gradient(760px 340px at 50% 0%,#000 25%,transparent 78%);
          mask-image:radial-gradient(760px 340px at 50% 0%,#000 25%,transparent 78%);
}
.tl-hero::after{
  content:'';position:absolute;left:0;right:0;bottom:0;height:110px;pointer-events:none;
  background:linear-gradient(to bottom,transparent,var(--bg-soft));
}
.tl-hero-in{max-width:880px;margin:0 auto;position:relative;z-index:1}

.tl-orb{position:absolute;border-radius:50%;pointer-events:none;filter:blur(46px);z-index:0}
.tl-orb.o1{width:280px;height:280px;left:3%;top:-70px;background:rgba(61,90,254,.18);animation:tlFloatA 13s ease-in-out infinite}
.tl-orb.o2{width:220px;height:220px;right:5%;top:-40px;background:rgba(124,77,255,.16);animation:tlFloatB 16s ease-in-out infinite}
.tl-orb.o3{width:180px;height:180px;left:42%;bottom:-80px;background:rgba(0,180,255,.12);animation:tlFloatA 19s ease-in-out infinite reverse}
@keyframes tlFloatA{0%,100%{transform:translate(0,0) scale(1)}50%{transform:translate(26px,18px) scale(1.09)}}
@keyframes tlFloatB{0%,100%{transform:translate(0,0) scale(1)}50%{transform:translate(-22px,16px) scale(1.07)}}
@media (prefers-reduced-motion:reduce){.tl-orb{animation:none}}

.tl-badge{
  display:inline-block;padding:7px 16px;border-radius:999px;font-size:.78rem;font-weight:700;
  color:var(--primary);background:rgba(61,90,254,.1);border:1px solid rgba(61,90,254,.18);margin-bottom:18px;
  backdrop-filter:blur(4px);letter-spacing:.3px;
}
.tl-hero h1{font-size:clamp(1.7rem,4.6vw,2.7rem);line-height:1.24;font-weight:800;letter-spacing:-.02em}
.tl-hero h1 em{font-style:normal;background:var(--grad-text);-webkit-background-clip:text;background-clip:text;color:transparent}
.tl-hero p{margin-top:16px;color:var(--ink-2);font-size:clamp(.88rem,2.3vw,1.02rem);line-height:1.75}

/* Hero 内大搜索框 */
.tl-hero-search{
  position:relative;max-width:620px;margin:28px auto 0;display:flex;align-items:center;
  background:var(--card);border:1.5px solid rgba(61,90,254,.18);border-radius:16px;
  padding:6px 6px 6px 16px;box-shadow:var(--shadow-m);transition:.22s;
}
.tl-hero-search:focus-within{border-color:var(--primary);box-shadow:0 0 0 4px rgba(61,90,254,.12),var(--shadow-m)}
.tl-hero-search .tl-search-ic{position:absolute;left:15px;top:50%;transform:translateY(-50%);width:18px;height:18px;color:var(--ink-3);pointer-events:none}
.tl-hero-search .tl-search-ic svg{width:100%;height:100%;display:block}
.tl-hero-search input{
  flex:1;border:none;background:transparent;font-size:.95rem;padding:12px 0 12px 26px;outline:none;color:var(--ink);min-width:0;
}
.tl-hero-search input::placeholder{color:#B0B6CE}
.tl-hero-go{
  flex:0 0 auto;background:var(--grad-main);color:#fff;font-weight:700;font-size:.9rem;
  padding:11px 24px;border-radius:12px;transition:var(--dur-mid);box-shadow:var(--glow-l);
}
.tl-hero-go:hover{transform:translateY(-1px);box-shadow:var(--glow-l)}
.tl-hero-go:active{transform:scale(.97)}

.tl-hero-act{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin-top:22px}

.tl-hero-stat{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:28px}
.tl-stat-pill{
  display:inline-flex;align-items:center;gap:7px;padding:10px 20px;border-radius:16px;
  background:rgba(255,255,255,.82);border:1px solid rgba(61,90,254,.14);
  box-shadow:var(--shadow-m);backdrop-filter:blur(6px);
  transition:var(--dur-mid) var(--ease, ease);
}
.tl-stat-pill:hover{transform:translateY(-2px);box-shadow:var(--glow-l)}
.tl-stat-pill b{
  font-weight:800;font-size:1.22rem;letter-spacing:-.01em;flex-shrink:0;
  background:var(--grad-text);-webkit-background-clip:text;background-clip:text;color:transparent;
}
.tl-stat-pill b.tl-stat-txt{font-size:1rem}
.tl-stat-pill span{color:var(--ink-3);font-size:.8rem}

/* ---------------- 主体 ---------------- */
.tl-wrap{max-width:min(100%,1440px);margin:0 auto;padding:36px 24px 80px}

/* ---------------- 信任背书 ---------------- */
.tl-trust{
  display:grid;grid-template-columns:repeat(4,1fr);gap:14px;
  margin:-2px 0 8px;
}
.tl-trust-item{
  display:flex;align-items:center;gap:12px;padding:16px 18px;border-radius:var(--r-m);
  background:var(--card);border:1px solid var(--line);transition:.22s var(--ease);
}
.tl-trust-item:hover{transform:translateY(-2px);box-shadow:var(--shadow-m);border-color:rgba(61,90,254,.25)}
.tl-trust-ic{
  width:42px;height:42px;border-radius:12px;display:grid;place-items:center;flex:0 0 auto;
  background:color-mix(in srgb,var(--c) 12%,#fff);color:var(--c);
}
.tl-trust-ic svg{width:21px;height:21px}
.tl-trust-item b{display:block;font-size:.92rem;font-weight:700;line-height:1.3}
.tl-trust-item small{display:block;color:var(--ink-3);font-size:.76rem;line-height:1.5;margin-top:2px}

/* ---------------- 区块 ---------------- */
.tl-sec{margin-top:52px}
.tl-sec-head{margin-bottom:22px}
.tl-sec-head h2{font-size:1.35rem;font-weight:800;letter-spacing:-.01em}
.tl-sec-head p{color:var(--ink-3);font-size:.86rem;margin-top:5px}
.tl-sec-title-wrap{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap}
.tl-count{color:var(--ink-3);font-size:.82rem}

/* 分类导航卡片 */
.tl-cats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}
.tl-cat{
  display:flex;align-items:center;gap:13px;padding:18px;border-radius:var(--r-m);
  background:var(--card);border:1.5px solid var(--line);cursor:pointer;
  transition:.22s var(--ease);text-align:left;
}
.tl-cat:hover{transform:translateY(-3px);border-color:rgba(61,90,254,.35);box-shadow:var(--shadow-m)}
.tl-cat[aria-current="true"]{border-color:var(--primary);box-shadow:0 0 0 3px rgba(61,90,254,.1)}
.tl-cat-ic{width:46px;height:46px;border-radius:13px;display:grid;place-items:center;flex:0 0 auto;overflow:hidden}
.tl-cat-ic svg{width:22px;height:22px}
.tl-cat-t{flex:1;min-width:0}
.tl-cat-t b{display:block;font-size:.95rem;font-weight:700;line-height:1.3}
.tl-cat-t small{display:block;color:var(--ink-3);font-size:.76rem;margin-top:3px}
.tl-cat-ar{color:var(--ink-3);font-size:1.1rem;transition:var(--dur-mid);flex:0 0 auto}
.tl-cat:hover .tl-cat-ar{color:var(--primary);transform:translateX(3px)}
.tl-cat-skel{height:84px;border-radius:var(--r-m);background:linear-gradient(100deg,var(--bg-soft) 30%,rgba(255,255,255,.65) 50%,var(--bg-soft) 70%);background-size:200% 100%;animation:tlSkel 1.2s infinite}

/* ---------------- 搜索栏（列表区） ---------------- */
.tl-bar{display:flex;gap:12px;align-items:center;margin-top:14px;flex-wrap:wrap}
.tl-search{position:relative;flex:1;min-width:220px;max-width:420px}
.tl-search-ic{position:absolute;left:13px;top:50%;transform:translateY(-50%);width:17px;height:17px;color:var(--ink-3);pointer-events:none}
.tl-search-ic svg{width:100%;height:100%;display:block}
.tl-input{
  width:100%;padding:11px 38px 11px 39px;border:1.5px solid var(--line);border-radius:12px;
  background:var(--card);font-size:.88rem;transition:.18s;
}
.tl-input:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(61,90,254,.1)}
.tl-clear{position:absolute;right:10px;top:50%;transform:translateY(-50%);width:24px;height:24px;border-radius:7px;color:var(--ink-3);font-size:.8rem;line-height:1}
.tl-clear:hover{background:var(--bg-soft);color:var(--ink)}
.tl-clear svg{width:13px;height:13px;display:block;margin:0 auto}
.tl-free{display:flex;align-items:center;gap:7px;font-size:.83rem;color:var(--ink-2);cursor:pointer;white-space:nowrap;padding:11px 15px;border:1.5px solid var(--line);border-radius:12px;background:var(--card)}
.tl-free:hover{border-color:rgba(61,90,254,.35)}
.tl-free input{accent-color:var(--primary);width:16px;height:16px}

.tl-filter-chip{
  display:inline-flex;align-items:center;gap:8px;margin-top:14px;padding:8px 14px;border-radius:999px;
  background:rgba(61,90,254,.08);border:1px solid rgba(61,90,254,.2);color:var(--primary);font-size:.82rem;
}
.tl-filter-chip button{margin-left:4px;padding:2px 8px;border-radius:999px;color:var(--primary);font-size:.76rem;font-weight:600;background:rgba(61,90,254,.1)}
.tl-filter-chip button svg{width:11px;height:11px;vertical-align:-1px;margin-right:2px}
.tl-filter-chip button:hover{background:rgba(61,90,254,.18)}

/* ---------------- 工具卡片 ---------------- */
.tl-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(238px,1fr));gap:16px}
.tl-card{
  background:var(--card);border:1.5px solid var(--line);border-radius:var(--r-m);padding:18px;
  display:flex;flex-direction:column;gap:9px;transition:.22s var(--ease);
  position:relative;overflow:hidden;text-decoration:none;color:inherit;
}
.tl-card::after{
  content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;
  background:linear-gradient(135deg,transparent 55%,rgba(61,90,254,.06));opacity:0;transition:.22s;
}
.tl-card:hover{transform:translateY(-4px);border-color:rgba(61,90,254,.4);box-shadow:var(--shadow-m)}
.tl-card:hover::after{opacity:1}
.tl-card-top{display:flex;align-items:center;gap:9px}
.tl-ic{width:42px;height:42px;border-radius:13px;display:grid;place-items:center;flex:0 0 auto;overflow:hidden}
.tl-ic svg{width:21px;height:21px;display:block}
.tool-ic-abbr{font-size:1rem;font-weight:800;line-height:1;letter-spacing:0}
.tl-hot{margin-left:auto;font-size:.68rem;font-weight:700;padding:3px 9px;border-radius:7px;background:rgba(244,63,94,.1);color:#E11D48;flex:0 0 auto}
.tl-card h3{font-size:.98rem;font-weight:750;line-height:1.35}
.tl-card p{
  font-size:.8rem;color:var(--ink-3);line-height:1.62;flex:1;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.tl-card-foot{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-top:2px}
.tl-kind{font-size:.68rem;font-weight:650;padding:3px 9px;border-radius:7px;background:var(--bg-soft);color:var(--ink-2)}
.tl-free-tag{font-size:.68rem;font-weight:700;padding:3px 9px;border-radius:7px;background:rgba(15,179,123,.12);color:var(--ok)}
.tl-card-go{margin-left:auto;font-size:.72rem;font-weight:700;color:var(--primary);opacity:0;transform:translateX(-4px);transition:.22s}
.tl-card:hover .tl-card-go{opacity:1;transform:translateX(0)}

.tl-skel{height:150px;border-radius:var(--r-m);background:linear-gradient(100deg,var(--bg-soft) 30%,rgba(255,255,255,.65) 50%,var(--bg-soft) 70%);background-size:200% 100%;animation:tlSkel 1.2s infinite}
@keyframes tlSkel{0%{background-position:200% 0}100%{background-position:-200% 0}}

.tl-more{display:flex;justify-content:center;margin-top:28px}
.tl-empty{text-align:center;padding:56px 20px;color:var(--ink-3)}
.tl-empty-ic{font-size:2.4rem;opacity:.3;margin-bottom:12px}
.tl-empty-ic svg{width:40px;height:40px;display:inline-block}
.tl-empty p{font-size:.88rem;margin-bottom:16px}
.tl-error{padding:26px;text-align:center;color:var(--err);font-size:.86rem}
.tl-muted{color:var(--ink-3);font-size:.85rem;line-height:1.7}

/* ---------------- 使用记录 ---------------- */
.tl-history{margin-top:64px;padding-top:34px;border-top:1px solid var(--line)}
.tl-hist-head{display:flex;align-items:center;gap:13px;margin-bottom:18px}
.tl-hist-h-l{display:flex;align-items:center;gap:12px;min-width:0;flex:1}
.tl-hist-h-ic{width:38px;height:38px;border-radius:12px;flex:0 0 auto;display:grid;place-items:center;background:linear-gradient(135deg,rgba(61,90,254,.12),rgba(124,77,255,.12));color:var(--primary);border:1px solid rgba(61,90,254,.14)}
.tl-hist-h-ic svg{width:18px;height:18px;display:block}
.tl-hist-head h2{font-size:1.1rem;font-weight:800;line-height:1.3}
.tl-hist-head small{display:block;color:var(--ink-3);font-size:.77rem;line-height:1.5;margin-top:1px}
.tl-hist-cnt{flex:0 0 auto;padding:3px 10px;border-radius:999px;font-size:.73rem;font-weight:700;color:var(--primary);background:rgba(61,90,254,.1);border:1px solid rgba(61,90,254,.16)}
.tl-hist-refresh{margin-left:auto;flex:0 0 auto;display:inline-flex;align-items:center;gap:6px}
.tl-hist-refresh.spin svg{animation:tlSpin .7s linear infinite}
@keyframes tlSpin{to{transform:rotate(360deg)}}

.tl-hist-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
@media (max-width:860px){.tl-hist-list{grid-template-columns:1fr}}
.tl-hist-list>.tl-muted{grid-column:1/-1}
.tl-hist-item{
  display:flex;align-items:center;gap:12px;padding:13px 15px;border-radius:var(--r-m);
  background:var(--card);border:1.5px solid var(--line);transition:.18s;min-width:0;text-decoration:none;color:inherit;
}
.tl-hist-item:hover{border-color:rgba(61,90,254,.35);transform:translateY(-1px);box-shadow:var(--shadow-m)}
.tl-hist-ic{width:35px;height:35px;border-radius:11px;display:grid;place-items:center;flex:0 0 auto;overflow:hidden}
.tl-hist-ic svg{width:17px;height:17px;display:block}
.tl-hist-t{flex:1;min-width:0}
.tl-hist-t b{display:block;font-size:.86rem;font-weight:680;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tl-hist-t small{color:var(--ink-3);font-size:.75rem;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tl-hist-pts{font-size:.73rem;color:var(--ink-3);flex:0 0 auto;padding:3px 9px;border-radius:999px;background:var(--bg-soft);white-space:nowrap}
.tl-hist-item.is-failed .tl-hist-pts{color:var(--err);background:rgba(239,68,68,.08)}

/* ---------------- 底部 CTA ---------------- */
.tl-cta{margin-top:64px}
.tl-cta-in{
  position:relative;overflow:hidden;text-align:center;padding:54px 24px;border-radius:var(--r-xl);
  background:radial-gradient(700px 300px at 50% 0%,rgba(124,77,255,.28),transparent 70%),
             radial-gradient(500px 260px at 80% 100%,rgba(61,90,254,.25),transparent 70%),var(--grad-card);
  color:#fff;box-shadow:var(--shadow-l);
}
.tl-cta-in h2{font-size:clamp(1.4rem,3.4vw,2rem);font-weight:800;letter-spacing:-.01em}
.tl-cta-in p{color:rgba(255,255,255,.85);margin-top:12px;font-size:.95rem}
.tl-cta-act{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin-top:26px}
.tl-cta-in .btn-primary{box-shadow:var(--shadow-m)}
.tl-cta-in .btn-ghost{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.3);color:#fff}
.tl-cta-in .btn-ghost:hover{background:rgba(255,255,255,.22);border-color:#fff;color:#fff}

/* ---------------- 移动端 ---------------- */
@media (max-width:900px){
  .tl-trust{grid-template-columns:repeat(2,1fr)}
  .tl-cats{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:640px){
  .tl-hero{padding:calc(var(--nav-h) + 30px) 16px 40px}
  .tl-hero h1{font-size:1.6rem}
  .tl-hero p{font-size:.88rem}
  .tl-hero-search{padding-left:14px}
  .tl-hero-go{padding:11px 18px;font-size:.85rem}
  .tl-wrap{padding:24px 14px 64px}
  .tl-trust{grid-template-columns:1fr 1fr;gap:10px}
  .tl-trust-item{flex-direction:column;align-items:flex-start;gap:9px;padding:14px}
  .tl-trust-item small{font-size:.72rem}
  .tl-trust-ic{width:38px;height:38px;border-radius:11px}
  .tl-trust-ic svg{width:18px;height:18px}
  .tl-sec{margin-top:40px}
  .tl-sec-head h2{font-size:1.18rem}
  .tl-cats{grid-template-columns:repeat(2,1fr);gap:10px}
  .tl-cat{padding:14px;gap:10px}
  .tl-cat-ic{width:40px;height:40px;border-radius:11px}
  .tl-cat-ic svg{width:19px;height:19px}
  .tl-cat-t b{font-size:.88rem}
  .tl-grid{grid-template-columns:repeat(2,1fr);gap:10px}
  .tl-card{padding:14px}
  .tl-card h3{font-size:.88rem}
  .tl-card p{-webkit-line-clamp:2;font-size:.74rem}
  .tl-ic{width:36px;height:36px;border-radius:11px}
  .tl-ic svg{width:18px;height:18px}
  .tl-bar{gap:9px}
  .tl-free{padding:10px 12px;font-size:.8rem}
  .tl-search{max-width:none}
  .tl-card-go{display:none}
  .tl-hist-list{grid-template-columns:1fr}
  .tl-hist-head{flex-wrap:wrap;gap:10px}
  .tl-hist-head small{display:none}
  .tl-hist-refresh{margin-left:0;width:100%;justify-content:center}
  .tl-orb{filter:blur(30px)}
  .tl-orb.o1{width:150px;height:150px;left:-6%;top:38%;opacity:.75}
  .tl-orb.o2{width:130px;height:130px;right:-4%;top:26%;opacity:.75}
  .tl-orb.o3{display:none}
  .tl-hero::before{display:none}
  .tl-hero::after{height:64px}
  .tl-hero-stat{gap:8px}
  .tl-stat-pill{padding:7px 13px}
  .tl-stat-pill b{font-size:.95rem}
  .tl-cta-in{padding:40px 18px}
}
/* 极窄屏 */
@media (max-width:360px){
  .tl-grid{grid-template-columns:1fr}
  .tl-trust{grid-template-columns:1fr}
}
