:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --text-1: #1e293b;
  --text-2: #64748b;
  --line: #e2e8f0;
  --primary: #2b6cff;
  --green: #25c16f;
  --red: #e5484d;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 8px 24px rgba(15, 23, 42, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- 头部品牌区 ---------- */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2b6cff 55%, #4f8cff 100%);
  color: #fff;
  padding: 52px 20px 46px;
  text-align: center;
}
.hero-inner { max-width: 880px; margin: 0 auto; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  margin-bottom: 16px;
}
.hero h1 { font-size: 30px; font-weight: 700; letter-spacing: 0.5px; }
.hero-sub { margin-top: 10px; font-size: 15px; opacity: 0.88; line-height: 1.6; }
.hero-meta { margin-top: 16px; }
.hero-count {
  font-size: 13px;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

/* ---------- 主体 ---------- */
.wrap { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 26px 20px 40px; }

.toolbar { margin-bottom: 18px; }
.search {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-2);
  box-shadow: var(--shadow);
}
.search:focus-within { border-color: var(--primary); }
.search input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 14px;
  background: transparent;
  color: var(--text-1);
}

/* ---------- 一级：分组卡片 ---------- */
.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 16px;
}
.group-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.group-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.group-card-head { display: flex; align-items: center; gap: 13px; }
.group-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #2b6cff, #4f8cff);
}
.group-info { flex: 1; min-width: 0; }
.group-name { font-size: 16.5px; font-weight: 700; word-break: break-all; }
.group-sub { margin-top: 3px; font-size: 12.5px; color: var(--text-2); }
.btn-open {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: #eef2ff;
  border: 1px solid #dbe3ff;
  border-radius: 8px;
  padding: 8px 13px;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}
.btn-open:hover { background: #e0e8ff; }
.group-shares { display: flex; flex-direction: column; gap: 7px; }
.group-shares-label { font-size: 12px; color: var(--text-2); }

/* ---------- 自定义网页卡片（后台「网页管理」添加）---------- */
.link-icon { background: linear-gradient(135deg, #0d9488, #2dd4bf); }

/* ---------- 二级：组内文件视图 ---------- */
.files-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 13px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease;
  white-space: nowrap;
}
.btn-back:hover { border-color: var(--primary); color: var(--primary); }
.files-title { font-size: 19px; font-weight: 700; }
.files-search { flex: 1; min-width: 200px; }
.folder-share-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: #f0f7ff;
  border: 1px solid #d6e6ff;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.fsb-label { font-size: 13px; font-weight: 600; color: #1d4ed8; }
.fsb-item { display: inline-flex; gap: 6px; }

/* ---------- 文件卡片 ---------- */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}.file-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.file-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }

.file-head { display: flex; align-items: flex-start; gap: 12px; }
.file-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}
.file-meta { flex: 1; min-width: 0; }
.file-name {
  font-size: 15px;
  font-weight: 600;
  word-break: break-all;
  line-height: 1.45;
}
.file-sub { margin-top: 4px; font-size: 12.5px; color: var(--text-2); }

.file-sources { display: flex; flex-direction: column; gap: 8px; }
.src-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
}
.src-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.src-name { font-size: 13px; color: var(--text-2); flex-shrink: 0; }
.src-code {
  font-size: 11.5px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  background: #eef2ff;
  color: #4338ca;
  border-radius: 5px;
  padding: 2px 7px;
  flex-shrink: 0;
}
.src-actions { margin-left: auto; display: flex; gap: 6px; flex-shrink: 0; }
.btn-dl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 7px;
  padding: 6px 12px;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s ease;
  white-space: nowrap;
}
.btn-dl:hover { opacity: 0.88; }
.btn-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.btn-copy:hover { color: var(--primary); border-color: var(--primary); }

.file-note { font-size: 12px; color: var(--text-2); line-height: 1.5; }

/* ---------- 空状态 / 页脚 ---------- */
.empty {
  text-align: center;
  color: var(--text-2);
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.foot {
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 20px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-2);
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  font-size: 13.5px;
  padding: 10px 20px;
  border-radius: 9px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.err { background: var(--red); }
[hidden] { display: none !important; }

@media (max-width: 560px) {
  .hero { padding: 40px 16px 34px; }
  .hero h1 { font-size: 24px; }
  .file-grid { grid-template-columns: 1fr; }
}
