:root {
  --page: #f2f3f5;
  --surface: #ffffff;
  --ink: #222222;
  --muted: #9a9a9a;
  --soft: #6b6b6b;
  --line: #efefef;
  --line-strong: #e5e5e5;
  --search: #f3f3f3;
  --announce: #f4f4f4;
  --check: #07c160;
  --download: #3ec8f0;
  --download-deep: #2bb6de;
  --warn-bg: #fff6d8;
  --warn-fg: #8a7040;
  --folder: #ffcc4d;
  --folder-side: #f5b942;
  --report: #b3b3b3;
  --header-border: #1a1a1a;
  --font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.app { min-height: 100vh; }
.shell {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--surface);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.04);
}

/* ---------- 顶栏 ---------- */
.hdr-search {
  flex: 1;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--header-border);
  border-radius: 999px;
  padding: 0 6px 0 10px;
}
.hdr-title { flex: 1; min-width: 0; padding: 0 8px; font-size: 15px; font-weight: 600; }
.hdr-title span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-search-btn { flex-shrink: 0; padding: 8px 10px; font-size: 15px; font-weight: 500; color: var(--ink); }
.hdr-icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--ink); cursor: pointer;
}
.hdr-tools { position: relative; }
.tools-menu {
  position: absolute; right: 0; top: 44px; z-index: 50;
  width: 160px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12); overflow: hidden;
}
.tools-menu[hidden] { display: none; }
.tools-menu button, .tools-menu a {
  display: block; width: 100%; text-align: left;
  padding: 11px 14px; font-size: 14px; color: var(--ink);
  background: none; border: none; cursor: pointer;
}
.tools-menu button:hover, .tools-menu a:hover { background: var(--search); }

/* ---------- 品牌行 ---------- */
.brand-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.brand-name { flex: 1; font-size: 15px; color: var(--soft); min-width: 0; }
.brand-report { background: none; border: none; color: var(--report); font-size: 13px; cursor: pointer; }

/* ---------- 搜索框 ---------- */
.search-form { padding: 0 16px 12px; }
.search-label {
  position: relative; display: flex; align-items: center;
}
.search-label .ui-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.search-input {
  width: 100%; height: 44px;
  border: none; border-radius: 999px;
  background: var(--search);
  padding: 0 16px 0 38px;
  font-size: 15px; color: var(--ink); outline: none;
}
.search-input::placeholder { color: var(--muted); }

/* ---------- 公告 ---------- */
.announce-wrap { padding: 0 16px 16px; }
.announce {
  background: var(--announce); border-radius: 14px;
  padding: 14px 16px; font-size: 15px; line-height: 1.7; color: var(--ink);
}

/* ---------- 列表行 ---------- */
.folder-row, .file-row {
  display: flex; align-items: center; gap: 14px;
  min-height: 72px; padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.folder-glyph, .file-icon { flex-shrink: 0; display: flex; }
.file-icon .app-icon { display: inline-flex; }
.app-icon {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 22%; overflow: hidden;
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row-main { flex: 1; min-width: 0; }
.row-title { display: block; font-size: 16px; font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-row .row-title { font-size: 16px; }
.file-row .row-title { font-size: 15px; }
.row-sub { margin-top: 2px; font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { margin-top: 4px; display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.row-chevron, .file-dl {
  flex-shrink: 0; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--search); border-radius: 999px; color: var(--muted);
}
.file-dl { border: 1.5px solid var(--download); color: var(--download); }

/* ---------- 面包屑 ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 0 16px 8px; font-size: 12px; color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.crumbs .crumb-cur { color: var(--ink); }

/* ---------- 空提示 / 页脚 ---------- */
.empty-hint { padding: 64px 24px; text-align: center; font-size: 14px; color: var(--muted); }
.footer-note { padding: 32px 24px; text-align: center; font-size: 11px; line-height: 1.6; color: var(--muted); }

/* ---------- 详情页 ---------- */
.detail { display: flex; flex-direction: column; align-items: center; padding: 16px 24px 24px; }
.detail-icon { margin-top: 8px; }
.detail h1 { margin: 20px 0 0; font-size: 22px; font-weight: 500; line-height: 1.4; text-align: center; }
.detail-meta { margin-top: 12px; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.detail-meta .brand-report { font-size: 13px; }
.dl-btn {
  margin-top: 32px; display: inline-flex; align-items: center; justify-content: center;
  min-width: 220px; height: 48px; padding: 0 32px;
  background: var(--download); color: #fff; border: none; border-radius: 10px;
  font-size: 17px; font-weight: 500; cursor: pointer; box-shadow: 0 2px 8px rgba(62,200,240,0.3);
}
.dl-btn:hover { background: var(--download-deep); }
.dl-btn:disabled { background: var(--search); color: var(--soft); cursor: default; box-shadow: none; }
.warn-bar {
  margin-top: 20px; width: 100%; text-align: center;
  background: var(--warn-bg); color: var(--warn-fg);
  border-radius: 8px; padding: 10px 12px; font-size: 12px; line-height: 1.5;
}
.detail-desc { border-top: 1px solid var(--line); margin-top: 24px; padding: 24px 20px; font-size: 16px; line-height: 2; color: var(--ink); }

/* ---------- 下载倒计时页 ---------- */
.dlpage { display: flex; flex-direction: column; align-items: center; padding: 40px 24px; }
.dlpage h1 { margin: 16px 0 0; font-size: 18px; font-weight: 500; text-align: center; }
.dlpage .dl-size { margin-top: 8px; font-size: 14px; color: var(--muted); }
.dl-wait {
  margin-top: 32px; min-width: 220px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--search); color: var(--soft); border-radius: 10px; font-size: 15px;
}
.dl-tip { margin-top: 24px; max-width: 280px; text-align: center; font-size: 12px; line-height: 1.6; color: var(--muted); }
.dl-back { margin-top: 24px; font-size: 14px; color: var(--download-deep); }

/* ---------- Toast ---------- */
.toast-host { position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: rgba(28,36,48,0.92); color: #fff; padding: 10px 18px;
  border-radius: 10px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  animation: toastIn .2s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Modal ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.4);
  display: flex; align-items: flex-end; justify-content: center; padding: 16px;
}
@media (min-width: 480px) { .modal-mask { align-items: center; } }
.modal-mask[hidden] { display: none; }
.modal {
  width: 100%; max-width: 380px; background: var(--surface);
  border-radius: 16px; padding: 16px; box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.modal h2 { margin: 0 0 12px; font-size: 16px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.modal p { font-size: 14px; line-height: 1.6; color: var(--soft); margin: 0 0 16px; }
.modal-actions { display: flex; gap: 8px; }
.btn {
  flex: 1; height: 44px; border: none; border-radius: 12px;
  font-size: 14px; font-weight: 500; cursor: pointer;
}
.btn-ghost { background: var(--search); color: var(--ink); }
.btn-primary { background: var(--download); color: #fff; }
.btn-primary:hover { background: var(--download-deep); }

/* ---------- 搜索高亮 ---------- */
mark { background: #fff2a8; color: inherit; padding: 0 1px; border-radius: 2px; }
