:root {
  --bg: #07080e;
  --card: #111524;
  --elev: #181e33;
  --code: #05070d;
  --border: rgba(148, 163, 184, 0.16);
  --rose: #fb7185;
  --amber: #f59e0b;
  --gold: #fde68a;
  --cyan: #38bdf8;
  --emerald: #34d399;
  --text: #f1f5f9;
  --soft: #cbd5e1;
  --muted: #8b9bb4;
}
[data-theme="light"] {
  --bg: #f8fafc;
  --card: #ffffff;
  --elev: #f1f5f9;
  --code: #0f172a;
  --border: rgba(15, 23, 42, 0.11);
  --rose: #e11d48;
  --amber: #d97706;
  --gold: #b45309;
  --cyan: #0284c7;
  --emerald: #059669;
  --text: #0f172a;
  --soft: #334155;
  --muted: #64748b;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.72; -webkit-font-smoothing: antialiased;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

.header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(7, 8, 14, 0.88); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border);
}
[data-theme="light"] .header { background: rgba(255, 255, 255, 0.92); }
.header-in {
  max-width: 1240px; margin: 0 auto; padding: 12px 20px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none !important; }
.brand-ico {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 20px;
  background: linear-gradient(135deg, rgba(251, 113, 133, 0.28), rgba(245, 158, 11, 0.28));
  border: 1px solid rgba(251, 113, 133, 0.45);
}
.brand-txt strong { display: block; color: var(--text); font-size: 16.5px; line-height: 1.2; }
.brand-txt span { display: block; color: var(--muted); font-size: 11px; }
.nav-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px;
  font-size: 12.8px; font-weight: 750; border: 1px solid var(--border); background: var(--card);
  color: var(--soft) !important; text-decoration: none !important; cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.btn:hover { border-color: var(--amber); color: var(--text) !important; transform: translateY(-1px); }
.btn.gold { border: none; background: linear-gradient(135deg, #fbbf24, #f97316); color: #09070d !important; }
.btn.cyan { border: none; background: linear-gradient(135deg, #38bdf8, #34d399); color: #041016 !important; }
.btn.rose { border-color: rgba(251, 113, 133, 0.5); background: rgba(251, 113, 133, 0.14); color: var(--rose) !important; }

.hero {
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 70% 55% at 25% 0%, rgba(251, 113, 133, 0.18), transparent 65%),
    radial-gradient(ellipse 65% 55% at 85% 20%, rgba(56, 189, 248, 0.14), transparent 65%),
    var(--bg);
}
.hero-in { max-width: 1180px; margin: 0 auto; padding: 52px 20px 44px; }
.kicker {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px; border-radius: 999px;
  background: rgba(251, 113, 133, 0.13); border: 1px solid rgba(251, 113, 133, 0.45);
  color: var(--rose); font-size: 12.5px; font-weight: 800; margin-bottom: 16px;
}
.hero h1 { font-size: clamp(32px, 5vw, 56px); font-weight: 950; line-height: 1.14; margin-bottom: 14px; }
.hl-rose { background: linear-gradient(135deg, #fda4af, #fb7185, #f59e0b); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hl-cyan { background: linear-gradient(135deg, #38bdf8, #34d399); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { max-width: 820px; font-size: 16.5px; color: var(--soft); margin-bottom: 24px; }

/* Spotlight Feature Card for Expensive Prayers */
.spotlight {
  margin-top: 24px; padding: 26px 28px; border-radius: 20px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.13), rgba(251, 113, 133, 0.13));
  border: 1px solid rgba(245, 158, 11, 0.5);
  display: flex; justify-content: space-between; align-items: center; gap: 22px; flex-wrap: wrap;
}
.spotlight-txt { flex: 1; min-width: 280px; }
.spotlight-txt .sp-k { font-size: 12px; font-weight: 850; color: var(--gold); letter-spacing: 0.06em; margin-bottom: 6px; }
.spotlight-txt h2 { font-size: clamp(22px, 2.8vw, 30px); font-weight: 900; margin-bottom: 8px; }
.spotlight-txt p { margin-bottom: 0; font-size: 14.8px; color: var(--soft); }

.wrap { max-width: 1240px; margin: 0 auto; padding: 28px 20px 64px; }
.toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; margin-bottom: 22px;
}
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  border: 1px solid transparent; background: transparent; color: var(--soft);
  padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.tab:hover { background: rgba(148, 163, 184, 0.1); color: var(--text); }
.tab.active { background: rgba(251, 113, 133, 0.15); border-color: rgba(251, 113, 133, 0.45); color: var(--rose); }
.search {
  flex: 1; min-width: 220px; max-width: 320px; padding: 8px 13px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 13.5px; outline: none;
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 18px; }
.vcard {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 22px;
  display: flex; flex-direction: column; gap: 11px; cursor: pointer; transition: all 0.18s;
}
.vcard:hover { transform: translateY(-4px); border-color: rgba(251, 113, 133, 0.55); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28); }
.vcard.featured { border-color: rgba(245, 158, 11, 0.5); background: linear-gradient(165deg, rgba(245, 158, 11, 0.08), var(--card) 55%); }
.vtop { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.vyear { font-family: ui-monospace, Menlo, monospace; font-size: 12px; font-weight: 800; color: var(--amber); }
.vloss {
  font-size: 11.5px; font-weight: 850; padding: 3px 9px; border-radius: 999px;
  background: rgba(251, 113, 133, 0.15); color: var(--rose); border: 1px solid rgba(251, 113, 133, 0.35); white-space: nowrap;
}
.vname { font-size: 18.5px; font-weight: 900; color: var(--text); line-height: 1.3; }
.vcve { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--cyan); }
.vdesc { font-size: 13.8px; color: var(--soft); }
.vfoot {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; font-size: 12.5px;
}

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 80; background: rgba(4, 6, 12, 0.8); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  width: 100%; max-width: 840px; max-height: 90vh; background: var(--card);
  border: 1px solid rgba(251, 113, 133, 0.45); border-radius: 22px; display: flex; flex-direction: column; overflow: hidden;
}
.modal-head {
  padding: 18px 24px; border-bottom: 1px solid var(--border); background: var(--elev);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.modal-close {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 18px; cursor: pointer;
}
.modal-body { padding: 24px 26px 30px; overflow-y: auto; font-size: 15px; color: var(--soft); }
.modal-body h3 { font-size: 17px; font-weight: 850; color: var(--text); margin: 18px 0 8px; padding-left: 10px; border-left: 3px solid var(--rose); }
.code-box { margin: 12px 0; border-radius: 12px; border: 1px solid var(--border); background: var(--code); overflow: hidden; }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 7px 13px; background: rgba(255,255,255,0.04); font-size: 12px; color: #94a3b8; font-family: ui-monospace, Menlo, monospace; }
.copy-btn { border: 1px solid rgba(56, 189, 248, 0.35); background: rgba(56, 189, 248, 0.14); color: #7dd3fc; padding: 3px 9px; border-radius: 6px; font-size: 11.5px; cursor: pointer; }
.code-box pre { padding: 14px; overflow-x: auto; font-family: ui-monospace, Menlo, monospace; font-size: 12.6px; line-height: 1.55; color: #e2e8f0; }

/* ECDSA Nonce Reuse Mini Lab */
.lab {
  margin-top: 40px; background: var(--card); border: 1px solid rgba(56, 189, 248, 0.38); border-radius: 20px; padding: 28px;
}
.lab h2 { font-size: 22px; font-weight: 900; margin-bottom: 8px; }
.lab-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 14px 0; }
.lab-box { background: var(--code); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }

.funnel {
  margin-top: 40px; padding: 34px 26px; border-radius: 22px; text-align: center;
  border: 1px solid rgba(56, 189, 248, 0.42);
  background: radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.16), transparent 50%), var(--card);
}
.funnel h2 { font-size: clamp(22px, 3vw, 31px); font-weight: 900; margin-bottom: 10px; }
.funnel p { max-width: 740px; margin: 0 auto 20px; color: var(--soft); }
footer { border-top: 1px solid var(--border); padding: 26px 20px 42px; text-align: center; font-size: 13px; color: var(--muted); }
footer p { margin-bottom: 6px; }
@media (max-width: 680px) { .grid { grid-template-columns: 1fr; } .spotlight { padding: 20px 18px; } }
