*{box-sizing:border-box;margin:0;padding:0}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang TC","Microsoft JhengHei",sans-serif;
  background:#f3f4f6;min-height:100vh;color:#1f2937;
  display:flex;flex-direction:column;align-items:center;
  padding:24px 14px 80px;
  overflow-y:auto;overflow-x:hidden;
}
body.admin-mode{padding-bottom:120px}
.hero{text-align:center;margin-bottom:24px;max-width:540px;width:100%}
.hero h1{font-size:28px;letter-spacing:1px;margin-bottom:6px;color:#1f2937}
.hero p{font-size:14px;color:#6b7280;line-height:1.6}

.section-back{width:100%;max-width:540px;margin-bottom:12px}
.section-back a{color:#6b7280;text-decoration:none;font-size:14px;display:inline-block;padding:6px 0}

.cat-card{
  display:block;width:100%;max-width:540px;
  border-radius:24px;padding:24px 20px;
  margin-bottom:18px;color:#fff;text-decoration:none;
  box-shadow:0 12px 32px rgba(0,0,0,.08);
  transition:transform .15s;position:relative;
}
.cat-card:active{transform:scale(.99)}
.cat-card .row{display:flex;align-items:center;gap:18px}
.cat-card .ic{
  font-size:48px;flex:0 0 auto;
  background:rgba(255,255,255,.18);
  width:72px;height:72px;border-radius:20px;
  display:flex;align-items:center;justify-content:center;
  backdrop-filter:blur(4px);
}
.cat-card .info{flex:1;min-width:0}
.cat-card h2{font-size:22px;margin-bottom:4px;text-shadow:0 2px 8px rgba(0,0,0,.15)}
.cat-card .desc{font-size:13px;opacity:.9;line-height:1.5}
.cat-card .count{font-size:11px;opacity:.8;margin-top:6px}

.hidden-badge{
  display:inline-block;font-size:10px;font-weight:700;
  background:rgba(255,255,255,.3);color:#fff;
  border-radius:6px;padding:1px 6px;margin-left:6px;
  vertical-align:middle;
}
.card .hidden-badge{background:#9ca3af}

.cards{
  width:100%;max-width:540px;
  display:grid;grid-template-columns:1fr;gap:10px;
}
.card{
  display:flex;align-items:center;gap:14px;
  background:#fff;border-radius:14px;padding:14px 16px;
  text-decoration:none;color:inherit;
  box-shadow:0 4px 14px rgba(0,0,0,.1);
  transition:transform .15s;position:relative;
}
.card:active{transform:scale(.98)}
.card .ico{font-size:32px;flex:0 0 auto;width:44px;text-align:center}
.card .meta{flex:1;min-width:0}
.card .meta h3{font-size:16px;margin-bottom:2px;color:#111827;display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.card .meta p{font-size:12px;color:#6b7280;line-height:1.5}
.tag{
  display:inline-block;font-size:10px;font-weight:700;color:#fff;
  border-radius:999px;padding:2px 8px;flex:0 0 auto;background:#6b7280;
}

.card.private,.cat-card.private{opacity:.55}

/* admin toggle switch */
.admin-toggle{
  position:absolute;top:14px;right:14px;
  width:44px;height:24px;cursor:pointer;
}
.admin-toggle input{
  position:absolute;opacity:0;width:0;height:0;
}
.admin-toggle .slider{
  display:block;width:44px;height:24px;
  background:#cbd5e1;border-radius:999px;position:relative;
  transition:background .2s;
}
.admin-toggle .slider:after{
  content:'';position:absolute;top:2px;left:2px;
  width:20px;height:20px;border-radius:999px;background:#fff;
  transition:left .2s;
  box-shadow:0 1px 3px rgba(0,0,0,.3);
}
.admin-toggle input:checked + .slider{background:#10b981}
.admin-toggle input:checked + .slider:after{left:22px}
.cat-card .admin-toggle .slider{background:rgba(255,255,255,.3)}
.cat-card .admin-toggle input:checked + .slider{background:#10b981}

.empty-state{
  color:#9ca3af;text-align:center;padding:32px 16px;
  background:#fff;border-radius:14px;
  box-shadow:0 4px 14px rgba(0,0,0,.06);
  font-size:14px;
}

.admin-bar{
  position:fixed;bottom:0;left:0;right:0;
  background:#1f2937;color:#fff;padding:12px 14px;
  display:flex;justify-content:space-between;align-items:center;
  font-size:13px;box-shadow:0 -4px 16px rgba(0,0,0,.2);
  z-index:50;gap:8px;flex-wrap:wrap;
}
.admin-bar .left{flex:1;min-width:0}
.admin-bar .actions{display:flex;gap:6px;flex-wrap:wrap}
.admin-bar button{
  background:#10b981;color:#fff;border:0;border-radius:8px;
  padding:8px 12px;font-size:13px;font-weight:600;cursor:pointer;
}
.admin-bar button.secondary{background:#6b7280}
.admin-bar .dirty{color:#fbbf24;font-weight:700}

footer{margin-top:24px;color:#9ca3af;font-size:12px;text-align:center;line-height:1.8}
footer a{color:#6b7280;text-decoration:none;cursor:pointer;display:inline-block;padding:4px 8px}
footer a:hover{color:#4b5563}

@media (max-height:800px){
  body{padding:16px 14px 80px}
  .hero{margin-bottom:16px}
  .hero h1{font-size:24px}
  .cat-card{padding:18px 16px;margin-bottom:14px}
  .cat-card .ic{font-size:40px;width:60px;height:60px}
  .cat-card h2{font-size:20px}
}
