/* ============================================================
   全局变量
   ============================================================ */
:root{
  --bg:#0b0f1a;
  --surface:rgba(255,255,255,.04);
  --surface-hover:rgba(255,255,255,.08);
  --border:rgba(255,255,255,.08);
  --text:#eef2f9;
  --muted:#8a94ab;
  --accent:#5b8cff;
  --accent-soft:rgba(91,140,255,.15);
  --radius:14px;
}
/* SVG 图标尺寸 */
.file-icon svg{
  width:24px;
  height:24px;
  stroke:currentColor;
}
.file-password{
  margin-top:6px;
  font-size:12px;
  color:#f5b851;
  background:rgba(245,184,81,.1);
  border:1px solid rgba(245,184,81,.25);
  border-radius:6px;
  padding:3px 9px;
  display:inline-block;
}
/* 外链提示 */
.external-hint{
  font-size:11.5px;
  color:#5e687f;
  margin-right:auto;
}
.external-hint{
  font-size:11.5px;
  color:#5e687f;
  margin-right:auto;
}
*{box-sizing:border-box;margin:0;padding:0}

body{
  min-height:100vh;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  background:var(--bg);
  color:var(--text);
  background-image:radial-gradient(circle at 15% 0%,rgba(91,140,255,.18),transparent 40%),
                   radial-gradient(circle at 85% 100%,rgba(139,92,246,.14),transparent 40%);
  background-attachment:fixed;
  -webkit-font-smoothing:antialiased;
  padding-bottom:60px;
}

/* ---------- 顶部导航 + 搜索 ---------- */
.topbar{
  position:sticky;top:0;z-index:10;
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  background:rgba(11,15,26,.75);
  border-bottom:1px solid var(--border);
}

.topbar-inner{
  max-width:1120px;margin:0 auto;
  display:flex;align-items:center;gap:24px;
  padding:16px 28px;
}

.logo{
  display:flex;align-items:center;gap:9px;
  font-weight:650;font-size:17px;letter-spacing:.2px;
  flex-shrink:0;
}
.logo-mark{
  width:30px;height:30px;border-radius:9px;
  display:grid;place-items:center;
  font-size:15px;font-weight:700;color:#fff;
  background:linear-gradient(135deg,#5b8cff,#8b5cf6);
  box-shadow:0 6px 16px rgba(91,140,255,.4);
}

.search-wrap{
  flex:1;
  position:relative;
  max-width:520px;
  margin-left:auto;
}

.search-icon{
  position:absolute;
  left:15px;top:50%;
  transform:translateY(-50%);
  width:18px;height:18px;
  color:var(--muted);
  pointer-events:none;
  transition:color .2s;
}

#searchInput{
  width:100%;
  padding:12px 44px 12px 46px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.05);
  color:var(--text);
  font-size:14.5px;
  font-family:inherit;
  outline:none;
  transition:all .22s ease;
}

#searchInput::placeholder{color:#5e687f}

#searchInput:focus{
  border-color:rgba(91,140,255,.6);
  background:rgba(91,140,255,.08);
  box-shadow:0 0 0 4px rgba(91,140,255,.1);
}

#searchInput:focus + .search-icon{
  color:var(--accent);
}

.clear-btn{
  position:absolute;
  right:10px;top:50%;
  transform:translateY(-50%);
  width:28px;height:28px;
  border-radius:8px;
  border:none;
  background:transparent;
  color:var(--muted);
  cursor:pointer;
  display:none;
  place-items:center;
  transition:background .15s,color .15s;
}
.clear-btn:hover{
  background:rgba(255,255,255,.08);
  color:var(--text);
}
.clear-btn.show{display:grid}

/* ---------- 主体 ---------- */
.container{
  max-width:1120px;
  margin:0 auto;
  padding:32px 28px 0;
}

.page-head{
  margin-bottom:26px;
}

.page-head h1{
  font-size:26px;
  font-weight:650;
  letter-spacing:-.01em;
}

.page-head p{
  margin-top:8px;
  color:var(--muted);
  font-size:14.5px;
}

/* ---------- 分类筛选 ---------- */
.filters{
  display:flex;
  flex-wrap:wrap;
  gap:9px;
  margin-top:22px;
}

.filter-btn{
  padding:7px 16px;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--surface);
  color:var(--muted);
  font-size:13.5px;
  font-family:inherit;
  cursor:pointer;
  transition:all .18s ease;
  white-space:nowrap;
}

.filter-btn:hover{
  background:var(--surface-hover);
  color:var(--text);
}

.filter-btn.active{
  background:var(--accent-soft);
  border-color:rgba(91,140,255,.45);
  color:#b9ccff;
}

/* ---------- 结果统计 ---------- */
.result-info{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin:28px 0 16px;
  font-size:13.5px;
  color:var(--muted);
}

.result-info .count strong{
  color:var(--text);
  font-weight:600;
}

/* ---------- 文件网格 ---------- */
.file-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(300px,1fr));
  gap:16px;
}

.file-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:20px;
  display:flex;
  flex-direction:column;
  gap:14px;
  transition:all .22s ease;
  animation:fadeUp .3s ease both;
}

@keyframes fadeUp{
  from{opacity:0;transform:translateY(8px)}
}

.file-card:hover{
  background:var(--surface-hover);
  border-color:rgba(255,255,255,.16);
  transform:translateY(-3px);
  box-shadow:0 14px 30px -12px rgba(0,0,0,.5);
}

.file-top{
  display:flex;
  align-items:flex-start;
  gap:14px;
}

.file-icon{
  width:44px;height:44px;
  border-radius:11px;
  display:grid;place-items:center;
  font-size:22px;
  background:rgba(255,255,255,.06);
  flex-shrink:0;
}

.file-title{
  flex:1;
  min-width:0;
}

.file-name{
  font-size:14.5px;
  font-weight:600;
  line-height:1.4;
  word-break:break-all;
}

.file-desc{
  font-size:12.5px;
  color:var(--muted);
  margin-top:4px;
  line-height:1.5;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.file-meta{
  display:flex;
  flex-wrap:wrap;
  gap:6px 14px;
  font-size:12px;
  color:var(--muted);
}

.file-meta span{
  display:flex;
  align-items:center;
  gap:4px;
}

.file-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  padding-top:14px;
  border-top:1px solid rgba(255,255,255,.06);
}

.btn-download{
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:9px 18px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.1);
  background:linear-gradient(135deg,#4a7dff,#7c5cf6);
  color:#fff;
  font-size:13px;
  font-weight:600;
  font-family:inherit;
  cursor:pointer;
  transition:all .2s ease;
  box-shadow:0 8px 20px -10px rgba(74,125,255,.8);
}

.btn-download:hover{
  transform:translateY(-1px);
  box-shadow:0 12px 26px -10px rgba(74,125,255,1);
}

.btn-download:active{
  transform:translateY(0) scale(.97);
}

.btn-download svg{
  width:15px;height:15px;
}

.btn-download.done{
  background:linear-gradient(135deg,#1f9d6b,#12b981);
  box-shadow:0 8px 20px -10px rgba(18,185,129,.8);
}

/* ---------- 空状态 ---------- */
.empty{
  display:none;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:80px 20px;
  text-align:center;
  color:var(--muted);
}

.empty.show{display:flex}

.empty-icon{
  font-size:48px;
  margin-bottom:16px;
  opacity:.6;
}

.empty h3{
  font-size:17px;
  font-weight:600;
  color:var(--text);
  margin-bottom:8px;
}

.empty p{
  font-size:14px;
  line-height:1.6;
}

/* ---------- 响应式 ---------- */
@media (max-width:640px){
  .topbar-inner{
    flex-wrap:wrap;
    padding:14px 18px;
    gap:12px;
  }
  .search-wrap{
    max-width:none;
    margin-left:0;
    width:100%;
    order:3;
  }
  .container{padding:24px 18px 0}
  .page-head h1{font-size:22px}
  .file-grid{grid-template-columns:1fr}
}
