:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --text: #1f2733;
  --muted: #6b7689;
  --primary: #3b5bdb;
  --primary-dark: #2f49b0;
  --accent: #f59f00;
  --border: #e6eaf2;
  --shadow: 0 6px 24px rgba(31, 39, 51, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
.container { width: min(1180px, 92vw); margin: 0 auto; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(150%) blur(6px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #5c7cfa);
  color: #fff; font-weight: 800; font-size: 22px;
  display: grid; place-items: center;
}
.brand h1 { font-size: 18px; margin: 0; }
.tagline { margin: 0; font-size: 12.5px; color: var(--muted); }
.admin-link { font-size: 14px; font-weight: 600; white-space: nowrap; }

/* Hero */
.hero { padding: 48px 0 28px; text-align: center; }
.hero h2 { font-size: 28px; margin: 0 0 10px; }
.hero p { color: var(--muted); margin: 0 auto; max-width: 620px; }

/* Toolbar */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 14px;
  align-items: center; justify-content: space-between;
  margin: 8px 0 26px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); padding: 7px 14px; border-radius: 999px;
  font-size: 13.5px; cursor: pointer; transition: .15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.search-box input {
  width: 260px; max-width: 100%; padding: 9px 14px;
  border: 1px solid var(--border); border-radius: 999px;
  font-size: 14px; background: var(--surface); outline: none;
}
.search-box input:focus { border-color: var(--primary); }

/* Grid */
.section-title { font-size: 18px; margin: 26px 0 14px; }
.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(31,39,51,.12); }
.card-cover {
  height: 150px; background-size: cover; background-position: center;
  display: grid; place-items: center; color: #fff; font-size: 40px; font-weight: 800;
  position: relative;
}
.card-cover .badge-cat {
  position: absolute; top: 10px; left: 10px;
  background: rgba(0,0,0,.45); color: #fff; font-size: 12px;
  padding: 3px 10px; border-radius: 999px;
}
.card-cover .badge-feat {
  position: absolute; top: 10px; right: 10px;
  background: var(--accent); color: #fff; font-size: 12px;
  padding: 3px 10px; border-radius: 999px; font-weight: 700;
}
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-size: 16px; font-weight: 700; margin: 0; }
.card-summary { font-size: 13.5px; color: var(--muted); margin: 0; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.card-link { color: var(--primary); font-weight: 600; }
.card-link:hover { text-decoration: underline; }
.card-qr-hint { background: #e6fcf5; color: #0ca678; padding: 1px 8px; border-radius: 999px; font-size: 11px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-上线 { background: #2f9e44; }
.status-开发中 { background: #f59f00; }
.status-演示 { background: #748ffc; }
.status-已下线 { background: #adb5bd; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* Footer */
.site-footer { margin-top: 50px; border-top: 1px solid var(--border); background: var(--surface); }
.site-footer .container { display: flex; justify-content: space-between; padding: 18px 0; color: var(--muted); font-size: 13px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; }
/* hidden 属性必须真正生效：.modal 上的 display:grid 会覆盖 UA 的 [hidden]{display:none}，
   这里用更高优先级（类+属性）把它压回去，否则弹窗会一直挂在页面上 */
.modal[hidden] { display: none !important; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.5); }
.modal-card {
  position: relative; background: var(--surface); border-radius: 16px;
  width: min(640px, 92vw); max-height: 86vh; overflow: auto; padding: 26px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal-close {
  position: absolute; top: 12px; right: 14px; border: none; background: transparent;
  font-size: 26px; cursor: pointer; color: var(--muted); line-height: 1;
}
.modal-cover { height: 200px; border-radius: 12px; background-size: cover; background-position: center;
  display: grid; place-items: center; color: #fff; font-size: 56px; font-weight: 800; margin-bottom: 16px; }
.detail-title { margin: 0 0 6px; font-size: 22px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.tag { background: #eef2ff; color: var(--primary); font-size: 12.5px; padding: 4px 10px; border-radius: 8px; }
.detail-desc { color: #36404f; white-space: pre-wrap; }
.detail-links { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.detail-qr { margin-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.detail-qr img { width: 180px; height: 180px; object-fit: contain; border-radius: 8px; background: #fff; }
.detail-qr span { font-size: 13px; color: var(--muted); }
.btn {
  display: inline-block; padding: 9px 16px; border-radius: 10px; font-size: 14px; font-weight: 600;
  background: var(--primary); color: #fff; border: none; cursor: pointer;
}
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }

@media (max-width: 600px) {
  .hero h2 { font-size: 22px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-box input { width: 100%; }
}
