/* ===== Toolbox Front UI ===== */
:root{
  --primary:#0f766e;
  --primary-strong:#115e59;
  --primary-soft:#ccfbf1;
  --primary-tint:#f0fdfa;
  --accent:#4f46e5;
  --accent-tint:#eef2ff;
  --warning:#d97706;
  --warning-tint:#fff7ed;
  --bg:#f6f8fb;
  --surface:#ffffff;
  --surface-soft:#f8fafc;
  --text:#111827;
  --text-soft:#334155;
  --muted:#64748b;
  --border:#dbe4ee;
  --border-strong:#cbd5e1;
  --shadow:0 1px 2px rgba(15,23,42,.05),0 10px 26px rgba(15,23,42,.06);
  --shadow-pop:0 18px 46px rgba(15,23,42,.13);
  --max:1180px;
  --radius:8px;
  --radius-sm:6px;
}
[data-theme="dark"]{
  --primary:#2dd4bf;
  --primary-strong:#5eead4;
  --primary-soft:rgba(45,212,191,.22);
  --primary-tint:rgba(45,212,191,.1);
  --accent:#a5b4fc;
  --accent-tint:rgba(165,180,252,.12);
  --warning:#fbbf24;
  --warning-tint:rgba(251,191,36,.12);
  --bg:#0f172a;
  --surface:#111c2f;
  --surface-soft:#172238;
  --text:#e5eefb;
  --text-soft:#cbd5e1;
  --muted:#94a3b8;
  --border:#26354d;
  --border-strong:#334155;
  --shadow:0 1px 2px rgba(0,0,0,.28),0 14px 36px rgba(0,0,0,.25);
  --shadow-pop:0 18px 46px rgba(0,0,0,.38);
}

*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{
  min-height:100vh;
  background:
    linear-gradient(180deg,rgba(15,118,110,.07),transparent 320px),
    linear-gradient(90deg,rgba(79,70,229,.05),transparent 42%),
    var(--bg);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",Arial,sans-serif;
  font-size:15px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none}
button,input{font:inherit}
.container{width:100%;max-width:var(--max);margin:0 auto;padding:0 24px}
.ui-icon{width:18px;height:18px;display:inline-block;vertical-align:-3px;flex:0 0 auto}
.site-bg{
  position:fixed;
  inset:0;
  pointer-events:none;
  background-image:
    linear-gradient(rgba(15,23,42,.045) 1px,transparent 1px),
    linear-gradient(90deg,rgba(15,23,42,.045) 1px,transparent 1px);
  background-size:48px 48px;
  mask-image:linear-gradient(to bottom,rgba(0,0,0,.75),transparent 72%);
}
[data-theme="dark"] .site-bg{
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px,transparent 1px),
    linear-gradient(90deg,rgba(255,255,255,.045) 1px,transparent 1px);
}

/* ===== Header ===== */
.site-header{
  position:sticky;
  top:0;
  z-index:100;
  border-bottom:1px solid var(--border);
  background:rgba(255,255,255,.88);
  backdrop-filter:blur(16px);
}
[data-theme="dark"] .site-header{background:rgba(15,23,42,.86)}
.header-inner{
  min-height:72px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:22px;
}
.logo{
  min-width:0;
  display:flex;
  align-items:center;
  gap:12px;
}
.logo-mark{
  width:42px;
  height:42px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:linear-gradient(180deg,var(--surface),var(--surface-soft));
  box-shadow:var(--shadow);
  font-size:22px;
  overflow:hidden;
}
.logo-mark .icon-img{width:100%;height:100%;object-fit:contain;padding:7px}
.logo-copy{min-width:0;display:flex;flex-direction:column}
.logo-text{
  max-width:220px;
  overflow:hidden;
  color:var(--text);
  font-size:17px;
  font-weight:800;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.logo-sub{margin-top:1px;color:var(--muted);font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase}
.header-right{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  min-width:0;
}
.search-box{
  width:100%;
  max-width:430px;
  min-height:42px;
  display:flex;
  align-items:center;
  gap:9px;
  padding:0 12px;
  border:1px solid var(--border-strong);
  border-radius:var(--radius);
  background:var(--surface);
  color:var(--muted);
  box-shadow:0 1px 1px rgba(15,23,42,.03);
  transition:border-color .15s ease,box-shadow .15s ease;
}
.search-box:focus-within{
  border-color:var(--primary);
  box-shadow:0 0 0 3px rgba(15,118,110,.13);
}
.search-icon{display:flex;color:var(--muted)}
.search-box input{
  min-width:0;
  flex:1;
  border:0;
  outline:0;
  background:transparent;
  color:var(--text);
}
.search-box input::placeholder{color:var(--muted)}
.search-clear{
  width:28px;
  height:28px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:var(--radius-sm);
  background:transparent;
  color:var(--muted);
  cursor:pointer;
}
.search-clear:hover{background:var(--surface-soft);color:var(--text)}
.theme-toggle,.admin-link{
  min-height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  border:1px solid var(--border-strong);
  border-radius:var(--radius);
  background:var(--surface);
  color:var(--text-soft);
  font-size:13px;
  font-weight:700;
  cursor:pointer;
}
.theme-toggle{width:42px}
.theme-toggle:hover,.admin-link:hover{border-color:var(--primary);color:var(--primary);background:var(--primary-tint)}
.admin-link{padding:0 12px}
.theme-icon-dark{display:none}
[data-theme="dark"] .theme-icon-light{display:none}
[data-theme="dark"] .theme-icon-dark{display:flex}

/* ===== Main / Hero ===== */
.main-content{position:relative;z-index:1;padding:26px 24px 76px}
.hero-section{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(300px,390px);
  gap:18px;
  align-items:stretch;
  margin-bottom:18px;
}
.hero-copy{
  min-height:190px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:28px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--surface);
  box-shadow:var(--shadow);
}
.hero-title{
  max-width:760px;
  color:var(--text);
  font-size:38px;
  line-height:1.16;
  font-weight:860;
  letter-spacing:0;
}
.hero-subtitle{
  max-width:720px;
  margin-top:12px;
  color:var(--muted);
  font-size:16px;
}
.stats-bar{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  padding:16px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--surface);
  box-shadow:var(--shadow);
}
.stats-standalone{grid-template-columns:repeat(3,1fr);margin-bottom:18px}
.stat-item{
  min-height:48px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  background:var(--surface-soft);
}
.stat-num{
  color:var(--text);
  font-size:24px;
  font-weight:850;
  font-variant-numeric:tabular-nums;
}
.stat-label{color:var(--muted);font-size:13px;font-weight:700}

/* ===== Category Tabs ===== */
.category-tabs{
  position:sticky;
  top:73px;
  z-index:80;
  display:flex;
  gap:8px;
  margin:0 0 20px;
  padding:10px 0;
  overflow-x:auto;
  scrollbar-width:none;
  background:linear-gradient(180deg,var(--bg),rgba(246,248,251,.86));
}
[data-theme="dark"] .category-tabs{background:linear-gradient(180deg,var(--bg),rgba(15,23,42,.86))}
.category-tabs::-webkit-scrollbar{display:none}
.cat-tab{
  min-height:38px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
  padding:7px 11px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--surface);
  color:var(--text-soft);
  font-size:13px;
  font-weight:750;
  white-space:nowrap;
  cursor:pointer;
  transition:background .15s ease,border-color .15s ease,color .15s ease,box-shadow .15s ease;
}
.cat-tab:hover{border-color:var(--primary);color:var(--primary)}
.cat-tab.active{
  border-color:var(--primary);
  background:var(--primary);
  color:#fff;
  box-shadow:0 8px 18px rgba(15,118,110,.18);
}
.cat-tab span:last-child{
  min-width:22px;
  padding:1px 7px;
  border-radius:999px;
  background:var(--surface-soft);
  color:var(--muted);
  font-size:12px;
}
.cat-tab.active span:last-child{background:rgba(255,255,255,.18);color:#fff}
.cat-tab .icon-img{width:20px;height:20px;object-fit:contain}

/* ===== Sections ===== */
.category-section{margin-bottom:24px}
.section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:12px;
}
.section-title{
  min-width:0;
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--text);
  font-size:20px;
  font-weight:820;
}
.section-icon{
  width:34px;
  height:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  background:var(--surface);
  font-size:18px;
  flex:0 0 auto;
}
.section-icon .icon-img{width:24px;height:24px;object-fit:contain}
.section-title-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.section-meta{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px;font-weight:700}
.section-meta span{
  min-height:26px;
  display:inline-flex;
  align-items:center;
  padding:3px 9px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--surface);
}

/* ===== Tool Cards ===== */
.tools-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(230px,1fr));
  gap:12px;
  margin-bottom:14px;
}
.tool-card{
  min-height:116px;
  display:flex;
  align-items:flex-start;
  gap:13px;
  position:relative;
  padding:16px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--surface);
  box-shadow:var(--shadow);
  transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease;
}
.tool-card:hover{
  transform:translateY(-2px);
  border-color:var(--primary-soft);
  box-shadow:var(--shadow-pop);
}
.tool-icon{
  width:46px;
  height:46px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--primary-tint);
  color:var(--primary);
  font-size:24px;
  overflow:hidden;
}
.tool-icon .icon-img{width:100%;height:100%;object-fit:contain;padding:6px}
.tool-info{min-width:0;flex:1;padding-right:22px}
.tool-name{
  color:var(--text);
  font-size:15px;
  font-weight:800;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.tool-desc{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  margin-top:5px;
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
}
.tool-arrow{
  position:absolute;
  right:14px;
  top:15px;
  color:var(--muted);
  opacity:.7;
}
.tool-card:hover .tool-arrow{color:var(--primary);opacity:1}

/* ===== Files ===== */
.files-list{display:grid;gap:10px}
.file-card{
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--surface);
  box-shadow:var(--shadow);
  transition:border-color .15s ease,box-shadow .15s ease;
}
.file-card:hover{border-color:var(--primary-soft);box-shadow:var(--shadow-pop)}
.file-download-link{
  min-height:82px;
  display:flex;
  align-items:center;
  gap:14px;
  padding:14px;
}
.file-icon{
  width:44px;
  height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--warning-tint);
  color:var(--warning);
  font-size:22px;
}
.file-info{min-width:0;flex:1}
.file-name{
  color:var(--text);
  font-weight:800;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.file-desc{
  margin-top:2px;
  color:var(--muted);
  font-size:13px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.file-meta{
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:wrap;
  margin-top:6px;
  color:var(--muted);
  font-size:12px;
  font-weight:650;
  font-variant-numeric:tabular-nums;
}
.file-dot{opacity:.55}
.file-netdisk{color:var(--accent);font-weight:800}
.file-code{
  min-height:22px;
  display:inline-flex;
  align-items:center;
  padding:1px 7px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--accent-tint);
  color:var(--accent);
}
.file-action{flex:0 0 auto}
.dl-btn{
  min-height:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  padding:7px 12px;
  border:1px solid var(--primary);
  border-radius:var(--radius-sm);
  background:var(--primary);
  color:#fff;
  font-size:13px;
  font-weight:800;
}
.file-card:hover .dl-btn{background:var(--primary-strong);border-color:var(--primary-strong)}

/* ===== Empty / Footer ===== */
.empty-state,.no-result{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-height:260px;
  padding:32px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--surface);
  color:var(--muted);
  text-align:center;
  box-shadow:var(--shadow);
}
.empty-icon{font-size:42px;margin-bottom:10px}
.empty-state h2,.no-result h2{color:var(--text);font-size:20px}
.empty-state a{color:var(--primary);font-weight:800}
.is-hidden{display:none!important}
.site-footer{
  position:relative;
  z-index:1;
  padding:28px 0;
  border-top:1px solid var(--border);
  background:var(--surface);
  color:var(--muted);
  font-size:13px;
  text-align:center;
}
.site-footer a{color:var(--primary);font-weight:750}
.lock-link{margin-top:8px}

/* ===== Responsive ===== */
@media(max-width:900px){
  .hero-section{grid-template-columns:1fr}
  .stats-bar{grid-template-columns:repeat(3,1fr)}
}
@media(max-width:720px){
  .container{padding:0 16px}
  .header-inner{min-height:auto;align-items:stretch;flex-direction:column;padding:12px 16px}
  .header-right{width:100%;justify-content:stretch}
  .search-box{max-width:none;flex:1}
  .admin-link span{display:none}
  .main-content{padding:18px 16px 56px}
  .hero-copy{min-height:150px;padding:22px}
  .hero-title{font-size:30px}
  .hero-subtitle{font-size:14px}
  .category-tabs{top:118px;margin-left:-16px;margin-right:-16px;padding:10px 16px}
  .stats-bar{grid-template-columns:1fr}
  .stat-item{min-height:54px}
  .section-head{align-items:flex-start;flex-direction:column}
  .tools-grid{grid-template-columns:1fr}
  .file-download-link{
    display:grid;
    grid-template-columns:44px minmax(0,1fr);
    align-items:flex-start;
  }
  .file-action{grid-column:2;justify-self:start}
}
@media(max-width:460px){
  .logo-text{max-width:170px}
  .hero-title{font-size:26px}
  .tool-card{min-height:auto}
  .file-download-link{gap:10px;padding:12px}
  .file-icon{width:40px;height:40px}
  .dl-btn{padding:7px 10px}
}
