:root {
  --bg-deep: #060913;
  --bg-card: rgba(14, 20, 36, 0.82);
  --bg-card-hover: rgba(20, 28, 49, 0.94);
  --border: rgba(148, 163, 184, 0.14);
  --border-tg: rgba(56, 189, 248, 0.44);
  --border-gold: rgba(245, 158, 11, 0.45);
  --tg-blue: #2aabee;
  --tg-deep: #229ed9;
  --cyan: #38bdf8;
  --indigo: #818cf8;
  --gold: #f59e0b;
  --gold-light: #fef08a;
  --emerald: #34d399;
  --text-main: #f8fafc;
  --text-sub: #cbd5e1;
  --text-muted: #94a3b8;
  --radius-xl: 24px;
  --radius-lg: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(circle at 14% 8%, rgba(42, 171, 238, 0.17) 0%, transparent 40%),
    radial-gradient(circle at 86% 14%, rgba(99, 102, 241, 0.16) 0%, transparent 40%),
    radial-gradient(circle at 50% 88%, rgba(245, 158, 11, 0.10) 0%, transparent 45%),
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 52px 52px, 52px 52px;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: 92px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 22px;
}

/* Top live status bar */
.top-ticker {
  background: linear-gradient(90deg, rgba(14, 116, 144, 0.28), rgba(79, 70, 229, 0.28), rgba(180, 83, 9, 0.25));
  border-bottom: 1px solid rgba(56, 189, 248, 0.22);
  font-size: 13px;
  color: #e0f2fe;
  padding: 9px 16px;
  text-align: center;
  font-weight: 600;
}

/* Sticky Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: rgba(6, 9, 19, 0.82);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 17px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .brand-domain { display: none; }
}
.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #38bdf8, #6366f1 55%, #f59e0b);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.32);
}
.brand-domain {
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.28);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sub);
}
.nav-links a:hover { color: #ffffff; }
@media (max-width: 780px) {
  .nav-links { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: transform 0.14s ease, box-shadow 0.2s ease, opacity 0.15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); opacity: 0.96; }
.btn:active { transform: scale(0.98); }

.btn-tg {
  background: linear-gradient(135deg, #38bdf8 0%, #2aabee 50%, #1d8cd8 100%);
  color: #ffffff;
  box-shadow: 0 10px 28px rgba(42, 171, 238, 0.36);
}
.btn-gold {
  background: linear-gradient(135deg, #fde047 0%, #f59e0b 60%, #d97706 100%);
  color: #090d16;
  box-shadow: 0 10px 26px rgba(245, 158, 11, 0.3);
}
.btn-glass {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.btn-glass:hover { border-color: var(--cyan); }
.btn-lg { padding: 15px 26px; font-size: 16px; border-radius: 14px; }

/* Hero + Dual TG Conversion Hub */
.hero {
  padding: 58px 0 38px;
  text-align: center;
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.11);
  border: 1px solid rgba(52, 211, 153, 0.36);
  color: #a7f3d0;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 20px;
}
.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
}
.hero h1 {
  font-size: clamp(26px, 5vw, 54px);
  font-weight: 900;
  line-height: 1.22;
  letter-spacing: -0.5px;
  margin-bottom: 18px;
}
.grad-txt {
  background: linear-gradient(90deg, #38bdf8 0%, #a78bfa 52%, #fde047 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-desc {
  max-width: 760px;
  margin: 0 auto 36px;
  font-size: clamp(15px, 2vw, 18px);
  color: var(--text-sub);
}

/* Primary Dual Telegram Cards */
.tg-hub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  text-align: left;
  margin-bottom: 20px;
}
@media (max-width: 820px) {
  .tg-hub-grid { grid-template-columns: 1fr; }
}
.tg-card {
  position: relative;
  border-radius: var(--radius-xl);
  padding: 28px;
  background: linear-gradient(155deg, rgba(14, 25, 48, 0.92), rgba(10, 15, 29, 0.96));
  border: 1.5px solid var(--border-tg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.42);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  overflow: hidden;
}
.tg-card.group-variant {
  border-color: var(--border-gold);
  background: linear-gradient(155deg, rgba(32, 23, 14, 0.88), rgba(11, 15, 28, 0.96));
}
.tg-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.tg-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(42, 171, 238, 0.18);
  color: #7dd3fc;
}
.tg-card.group-variant .tg-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #fde047;
}
.tg-handle {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 4px 10px;
  border-radius: 8px;
}
.tg-card h2 {
  font-size: 23px;
  font-weight: 900;
  margin-top: 10px;
  margin-bottom: 8px;
}
.tg-card p {
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.58;
}
.tg-perks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.perk-chip {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 4px 11px;
  border-radius: 8px;
}
.tg-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tg-actions .btn-main { flex: 1; }

.tg-helper-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 13px 20px;
  border-radius: 14px;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-sub);
}
.link-inline {
  color: var(--cyan);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Filter + Search Bar */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 46px 0 22px;
}
.section-title {
  font-size: 24px;
  font-weight: 900;
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.filter-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-sub);
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.filter-btn.active {
  background: var(--cyan);
  color: #06101e;
  border-color: var(--cyan);
}
.search-input {
  background: rgba(12, 18, 34, 0.9);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: #fff;
  padding: 8px 16px;
  font-size: 13px;
  min-width: 210px;
  outline: none;
}
.search-input:focus { border-color: var(--cyan); }

/* Tool Directory Cards */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 980px) { .tools-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .tools-grid { grid-template-columns: 1fr; } }

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: transform 0.16s ease, border-color 0.2s ease, background 0.2s;
}
.tool-card:hover {
  transform: translateY(-3px);
  background: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.42);
}
.tool-card.featured {
  border-color: rgba(245, 158, 11, 0.45);
  background: linear-gradient(165deg, rgba(28, 23, 16, 0.85), rgba(14, 20, 36, 0.92));
}
.tool-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tool-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.status-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}
.tag-hot { background: rgba(245, 158, 11, 0.2); color: #fde047; }
.tag-free { background: rgba(52, 211, 153, 0.18); color: #6ee7b7; }
.tag-pro { background: rgba(129, 140, 248, 0.2); color: #c7d2fe; }

.tool-title {
  font-size: 19px;
  font-weight: 800;
  margin-top: 12px;
  margin-bottom: 6px;
}
.tool-desc {
  font-size: 13.5px;
  color: var(--text-sub);
  line-height: 1.56;
}
.tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.mini-tag {
  font-size: 11.5px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.045);
  padding: 3px 9px;
  border-radius: 6px;
}
.tool-btns {
  display: flex;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.tool-btns .btn { flex: 1; padding: 9px 12px; font-size: 13px; }

/* Why Join TG Section */
.steps-banner {
  margin-top: 52px;
  background: linear-gradient(135deg, rgba(14, 28, 54, 0.9), rgba(20, 16, 42, 0.92));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 22px;
}
@media (max-width: 780px) { .steps-grid { grid-template-columns: 1fr; } }
.step-item {
  background: rgba(6, 10, 22, 0.65);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}
.step-no {
  display: inline-block;
  font-size: 12px;
  font-weight: 900;
  color: #06101e;
  background: var(--cyan);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.step-item h4 { font-size: 16px; margin-bottom: 6px; }
.step-item p { font-size: 13px; color: var(--text-sub); }

footer {
  margin-top: 56px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* Mobile Floating Bottom Telegram CTA Bar */
.mobile-tg-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: rgba(8, 12, 24, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(56, 189, 248, 0.3);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  gap: 10px;
}
.mobile-tg-bar .btn { flex: 1; padding: 12px 10px; font-size: 13.5px; }
@media (max-width: 780px) {
  .mobile-tg-bar { display: flex; }
}

/* Modal */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 6, 14, 0.78);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-mask.open { display: flex; }
.modal-box {
  width: 100%;
  max-width: 560px;
  background: #0d1324;
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: 22px;
  padding: 26px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-head h3 { font-size: 19px; font-weight: 900; }
.close-btn {
  background: rgba(255,255,255,0.08);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
}
.modal-body { font-size: 14px; color: var(--text-sub); line-height: 1.7; }
.modal-body ol, .modal-body ul { padding-left: 20px; margin: 10px 0; }
.modal-body li { margin-bottom: 8px; }
.qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.04);
  padding: 20px;
  border-radius: 16px;
  margin: 12px 0;
}
.qr-wrap img {
  width: 190px;
  height: 190px;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.toast {
  position: fixed;
  bottom: 86px;
  left: 50%;
  transform: translateX(-50%) translateY(14px);
  background: #0f172a;
  border: 1px solid var(--cyan);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 120;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
