:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --text: #1f2328;
  --muted: #6b7280;
  --border: #e6e8ec;
  --brand: #2563eb;
  --brand-soft: #eef2ff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .06);
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--brand);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex: none;
}

.brand-text h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .2px;
}

.brand-text p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.tools input[type="search"] {
  width: 220px;
  max-width: 100%;
  height: 38px;
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.tools input[type="search"]:focus {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* ---------- 主区 ---------- */
main { flex: 1; padding: 28px 0 40px; }

.group-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 14px;
}

.group-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .4px;
}

.count {
  font-size: 12px;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 14px;
}

/* ---------- 模块卡片 ---------- */
.card {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: #d6dae2;
  box-shadow: 0 2px 4px rgba(16, 24, 40, .05), 0 12px 28px rgba(16, 24, 40, .10);
}

.card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.card-icon {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 10px;
  background: var(--brand-soft);
  display: grid;
  place-items: center;
  font-size: 19px;
  line-height: 1;
}

.card-body { min-width: 0; }

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  margin: 2px 0 4px;
}

.card-desc {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tag {
  flex: none;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 400;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 999px;
}

.card.disabled { cursor: not-allowed; opacity: .6; }
.card.disabled:hover { transform: none; box-shadow: var(--shadow); border-color: var(--border); }

.empty {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--panel);
  padding: 16px 0;
}

.footer span {
  font-size: 12.5px;
  color: var(--muted);
}

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 4px 1px;
  border-radius: 50%;
  background: #22c55e;
}

@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .tools input[type="search"] { width: 100%; }
  .topbar-inner { min-height: 64px; padding: 10px 0; }
}

/* ---------- 右上角扫码 ---------- */
.tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qr-wrap { position: relative; }
.qr-btn {
  height: 38px;
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid #d6deff;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}
.qr-btn:active { background: #dde6ff; }
.qr-pop {
  position: absolute;
  right: 0;
  top: 46px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(16, 24, 40, .15);
  padding: 12px;
  display: none;
  z-index: 30;
  text-align: center;
}
.qr-pop.show { display: block; }
.qr-box { background: #fff; padding: 4px; border-radius: 6px; line-height: 0; }
.qr-box svg { display: block; }
.qr-cap { font-size: 12px; color: var(--muted); margin-top: 6px; }
.qr-close { position: absolute; top: 4px; right: 8px; color: #9aa1ac; cursor: pointer; font-size: 16px; line-height: 1; }
