:root {
  --bg: #f4f7fe;
  --surface: #ffffff;
  --text: #1a1d2b;
  --muted: #6e7894;
  --brand: #4c7cff;
  --brand-dark: #3563f5;
  --brand-soft: #eef3ff;
  --tag-bg: #eef4ff;
  --tag-color: #4c7cff;
  --accent: #ff5e5e;
  --accent-dark: #e84545;
  --border: #e8ecf7;
  --shadow: 0 8px 24px rgba(30, 42, 90, 0.08);
  --shadow-hover: 0 14px 36px rgba(30, 42, 90, 0.14);
  --radius: 18px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.wrap { max-width: 1220px; margin: 0 auto; padding: 0 24px; }

/* ---------- 顶部 Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(120deg, #e9efff 0%, #f0f4ff 40%, #e6f0ff 100%);
  padding: 70px 0 90px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  left: -10%; top: -30%;
  width: 50%; height: 140%;
  background: radial-gradient(circle, rgba(76,124,255,.10) 0%, transparent 60%);
  pointer-events: none;
}
.hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 50px; position: relative; z-index: 1; }
.hero-content { flex: 1; min-width: 0; }
.hero h1 { margin: 0 0 14px; font-size: 42px; line-height: 1.18; }
.hero h1 .free { color: var(--brand-dark); }
.hero .sub { margin: 0 0 30px; font-size: 17px; color: var(--muted); max-width: 520px; }
.hero-feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; max-width: 600px; }
.hero-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.hero-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--brand-soft); display: flex; align-items: center; justify-content: center; flex: none; }
.hero-icon img { width: 28px; height: 28px; object-fit: contain; }
.hero-item strong { display: block; font-size: 15px; color: var(--text); }
.hero-item span { font-size: 13px; color: var(--muted); }

/* 右侧动画装饰 */
.hero-animation {
  flex: none;
  position: relative;
  width: 320px; height: 320px;
  display: flex; align-items: center; justify-content: center;
}
.orbit {
  position: absolute;
  border: 1.5px dashed rgba(76, 124, 255, 0.18);
  border-radius: 50%;
  animation: spin 18s linear infinite;
}
.orbit-one { width: 260px; height: 260px; }
.orbit-two { width: 200px; height: 200px; animation-direction: reverse; animation-duration: 14s; }
@keyframes spin { to { transform: rotate(360deg); } }
.main-device {
  position: relative;
  z-index: 2;
  width: 150px; height: 170px;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow), 0 24px 60px rgba(76, 124, 255, 0.14);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px solid var(--border);
}
.device-top { font-size: 11px; letter-spacing: 1.5px; color: var(--muted); margin-bottom: 10px; }
.device-icon { width: 70px; height: 70px; border-radius: 18px; overflow: hidden; background: #fffbe8; display: flex; align-items: center; justify-content: center; }
.device-icon img { width: 52px; height: 52px; object-fit: contain; }
.device-text { margin-top: 10px; font-size: 12px; color: var(--muted); }
.float-card {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 6px;
  animation: float 4s ease-in-out infinite;
}
.float-card span { color: var(--brand); font-weight: 700; }
.card-a { top: 40px; right: 0; animation-delay: 0s; }
.card-b { bottom: 70px; left: 0; animation-delay: 1.3s; }
.card-c { bottom: 20px; right: 30px; animation-delay: 2.6s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ---------- 搜索 & 分类 ---------- */
.toolbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244, 247, 254, 0.92);
  backdrop-filter: blur(10px);
  padding: 16px 0;
  border-bottom: 1px solid rgba(232, 236, 247, 0.8);
}
.search-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.search {
  flex: 1 1 260px;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 11px 18px;
  box-shadow: var(--shadow);
  max-width: 460px;
}
.search input { border: none; outline: none; flex: 1; font-size: 15px; background: transparent; color: var(--text); }
.search svg { flex: none; color: var(--muted); }
.catnav { display: flex; gap: 8px; flex-wrap: wrap; flex: 1 1 auto; justify-content: flex-end; }
.catnav a {
  padding: 8px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 14px; color: var(--muted);
  transition: all 0.15s ease;
}
.catnav a:hover, .catnav a.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- 区块 ---------- */
.section { padding: 38px 0 6px; scroll-margin-top: 96px; }
.section-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
}
.section-head::before {
  content: "";
  width: 5px; height: 22px; border-radius: 3px;
  background: var(--brand);
}
.section-head h2 { margin: 0; font-size: 22px; }
.section-head .count {
  font-size: 13px; color: var(--muted); background: var(--brand-soft);
  padding: 2px 10px; border-radius: 999px; margin-left: 4px;
}

/* ---------- 卡片网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}
.soft-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.soft-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.soft-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.soft-logo {
  width: 58px; height: 58px; border-radius: 14px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  flex: none; overflow: hidden; border: 1px solid var(--border);
}
.soft-logo img { width: 46px; height: 46px; object-fit: contain; }
.logo-error { display: none; font-size: 24px; }
.soft-info { min-width: 0; }
.soft-info h3 { margin: 0 0 5px; font-size: 16px; font-weight: 600; line-height: 1.35; }
.soft-info span { font-size: 13px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soft-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; min-height: 26px; }
.tag {
  font-size: 12px; color: var(--tag-color);
  background: var(--tag-bg);
  padding: 3px 10px; border-radius: 6px;
}
.soft-download { margin-top: auto; position: relative; }
.btn-download {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 14px; cursor: pointer;
  transition: background 0.15s ease;
}
.btn-download:hover { background: var(--accent-dark); }
.btn-download svg { flex: none; }
.btn-download.disabled { background: #c7cdd8; cursor: default; }

/* 多网盘下拉 */
.dl-menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
  padding: 6px;
  display: none; flex-direction: column; gap: 4px; z-index: 10;
}
.dl-menu.show { display: flex; }
.dl-menu a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: 6px;
  font-size: 13px; color: var(--text);
}
.dl-menu a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.dl-menu .provider { color: var(--muted); font-size: 12px; }

/* ---------- 下载弹窗 ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(20, 25, 35, 0.55);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-overlay.show { display: flex; }
.download-modal {
  background: var(--surface);
  border-radius: 20px;
  width: 100%; max-width: 480px;
  box-shadow: 0 24px 60px rgba(20, 25, 35, 0.25);
  overflow: hidden;
  animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 18px; }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 10px 18px 18px; }
.dl-option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.dl-option:last-child { border-bottom: none; }
.dl-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dl-provider {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex: none; font-size: 15px; background: var(--brand-soft);
}
.dl-name { font-size: 14px; color: var(--text); }
.dl-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 999px; flex: none;
  background: #eef4ff; color: var(--brand-dark);
}
.dl-tag.rec {
  background: #ffeff0; color: #ff5e5e;
}
.dl-tag.bak {
  background: #f3f4f6; color: var(--muted);
}
.dl-btn {
  flex: none;
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--accent); color: #fff; border: none; border-radius: 999px;
  padding: 7px 14px; font-size: 13px; cursor: pointer;
}
.dl-btn:hover { background: var(--accent-dark); }
.dl-more {
  margin-top: 10px; text-align: right;
}
.dl-more a {
  font-size: 13px; color: var(--brand-dark);
  display: inline-flex; align-items: center; gap: 4px;
}

.empty { text-align: center; color: var(--muted); padding: 50px 0; font-size: 15px; }

/* ---------- 页脚 ---------- */
.footer {
  margin-top: 60px; padding: 30px 0;
  border-top: 1px solid var(--border);
  text-align: center; color: var(--muted); font-size: 13px;
}
.footer a { color: var(--brand-dark); }

/* ---------- 后台入口 ---------- */
.admin-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  background: var(--surface); color: var(--brand-dark);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 10px 18px; font-size: 13px; box-shadow: var(--shadow);
  display: inline-flex; align-items: center; gap: 6px;
}
.admin-fab:hover { background: var(--brand-soft); }

.toast {
  position: fixed; left: 50%; top: 20px; transform: translateX(-50%);
  background: #1f2933; color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 14px; z-index: 70; opacity: 0; transition: opacity 0.2s;
  pointer-events: none;
}
.toast.show { opacity: 1; }

/* 响应式 */
@media (max-width: 860px) {
  .hero { padding: 40px 0 55px; }
  .hero-inner { flex-direction: column; text-align: center; gap: 32px; }
  .hero h1 { font-size: 28px; }
  .hero .sub { margin-left: auto; margin-right: auto; font-size: 15px; }
  .hero-feature-grid { margin: 0 auto; grid-template-columns: 1fr; max-width: 360px; }
  .hero-animation { width: 220px; height: 220px; transform: scale(0.85); }
  .toolbar { padding: 12px 0; }
  .search-row { gap: 10px; }
  .search { flex: 1 1 100%; max-width: none; padding: 10px 14px; }
  .catnav { justify-content: flex-start; width: 100%; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: none; -ms-overflow-style: none; }
  .catnav::-webkit-scrollbar { display: none; }
  .catnav a { white-space: nowrap; padding: 7px 13px; font-size: 13px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
}
@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .hero h1 { font-size: 24px; }
  .hero .sub { font-size: 14px; }
  .hero-item { padding: 12px 14px; }
  .hero-icon { width: 40px; height: 40px; }
  .hero-icon img { width: 24px; height: 24px; }
  .hero-animation { display: none; }
  .grid { grid-template-columns: 1fr; }
  .soft-card { padding: 16px; }
  .soft-logo { width: 50px; height: 50px; }
  .soft-logo img { width: 40px; height: 40px; }
  .section { padding: 26px 0 4px; }
  .section-head h2 { font-size: 18px; }
  .download-modal { border-radius: 16px; max-width: 100%; }
  .modal-header { padding: 14px 16px; }
  .modal-header h3 { font-size: 16px; }
  .modal-body { padding: 8px 14px 14px; }
  .dl-option { gap: 8px; padding: 10px 0; }
  .dl-name { font-size: 13px; }
  .dl-btn { padding: 6px 11px; font-size: 12px; }
  .footer { font-size: 12px; }
}
