*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:              #ffffff;
  --bg-2:            #f5f5f7;
  --bg-3:            #ebebeb;
  --bg-card:         #ffffff;
  --border:          rgba(0,0,0,0.07);
  --border-md:       rgba(0,0,0,0.12);
  --border-strong:   rgba(0,0,0,0.18);
  --text:            #1d1d1f;
  --text-2:          #3a3a3c;
  --text-3:          #6e6e73;
  --text-4:          #aeaeb2;
  --accent:          #0071e3;
  --accent-h:        #0077ed;
  --accent-light:    rgba(0,113,227,0.08);
  --green:           #34c759;
  --green-light:     rgba(52,199,89,0.1);
  --red:             #ff3b30;
  --red-light:       rgba(255,59,48,0.08);
  --pill-bg:         #f0f0f5;
  --pill-on:         #1d1d1f;
  --pill-on-text:    #ffffff;
  --skel:            #e5e5ea;
  --skel-shine:      #f2f2f7;
  --sh-sm:           0 1px 4px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.04);
  --sh-md:           0 4px 20px rgba(0,0,0,0.07), 0 1px 6px rgba(0,0,0,0.04);
  --sh-lg:           0 16px 48px rgba(0,0,0,0.09), 0 4px 12px rgba(0,0,0,0.05);
  --r:               16px;
  --r-sm:            10px;
  --r-xs:            6px;
  --r-pill:          999px;
  --ease:            cubic-bezier(0.4,0,0.2,1);
  --t:               0.2s;
}

[data-theme="dark"] {
  --bg:              #000000;
  --bg-2:            #1c1c1e;
  --bg-3:            #2c2c2e;
  --bg-card:         #1c1c1e;
  --border:          rgba(255,255,255,0.07);
  --border-md:       rgba(255,255,255,0.11);
  --border-strong:   rgba(255,255,255,0.18);
  --text:            #f5f5f7;
  --text-2:          #d1d1d6;
  --text-3:          #8e8e93;
  --text-4:          #48484a;
  --accent:          #2997ff;
  --accent-h:        #409cff;
  --accent-light:    rgba(41,151,255,0.12);
  --green-light:     rgba(52,199,89,0.12);
  --red-light:       rgba(255,59,48,0.12);
  --pill-bg:         #2c2c2e;
  --pill-on:         #f5f5f7;
  --pill-on-text:    #1d1d1f;
  --skel:            #2c2c2e;
  --skel-shine:      #3a3a3c;
  --sh-sm:           0 1px 4px rgba(0,0,0,0.4);
  --sh-md:           0 4px 20px rgba(0,0,0,0.5);
  --sh-lg:           0 16px 48px rgba(0,0,0,0.6);
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: -apple-system, 'Inter', 'Helvetica Neue', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
  overflow-x: hidden;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255,255,255,0.82);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--border);
  transition: background var(--t) var(--ease);
}

[data-theme="dark"] .header { background: rgba(0,0,0,0.78); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 1;
  min-width: 0;
}

.logo-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 8px;
}

.logo-words {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.logo-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-caption {
  font-size: 0.62rem;
  font-weight: 400;
  color: var(--text-3);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-md);
  background: var(--bg-2);
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--t) var(--ease), transform 0.15s, border-color var(--t) var(--ease);
}

.theme-btn:hover { background: var(--bg-3); transform: scale(1.06); border-color: var(--border-strong); }
.theme-btn:active { transform: scale(0.95); }

.icon-sun  { display: block; }
.icon-moon { display: none;  }
[data-theme="dark"] .icon-sun  { display: none;  }
[data-theme="dark"] .icon-moon { display: block; }

.hero {
  padding: 80px 0 52px;
  text-align: center;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border-md);
  border-radius: var(--r-pill);
  padding: 6px 16px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 32px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: ping 2.2s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(52,199,89,0.5);
}

@keyframes ping {
  0%   { box-shadow: 0 0 0 0   rgba(52,199,89,0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(52,199,89,0);    }
  100% { box-shadow: 0 0 0 0   rgba(52,199,89,0);    }
}

.hero-h1 {
  font-size: clamp(2.4rem, 6.5vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 20px;
}

.hero-h1 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 700;
}

.hero-p {
  font-size: clamp(0.95rem, 2.6vw, 1.1rem);
  font-weight: 400;
  color: var(--text-3);
  line-height: 1.7;
  max-width: 500px;
  margin-bottom: 44px;
}

.search-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-md);
  border-radius: var(--r);
  padding: 20px 20px 18px;
  box-shadow: var(--sh-lg);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}

.search-card:focus-within {
  border-color: rgba(0,113,227,0.3);
  box-shadow: var(--sh-lg), 0 0 0 4px rgba(0,113,227,0.06);
}

[data-theme="dark"] .search-card:focus-within {
  border-color: rgba(41,151,255,0.3);
  box-shadow: var(--sh-lg), 0 0 0 4px rgba(41,151,255,0.08);
}

.search-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0 16px;
  min-width: 0;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease);
}

.input-wrap:focus-within {
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(0,113,227,0.12);
}

[data-theme="dark"] .input-wrap:focus-within {
  box-shadow: 0 0 0 3px rgba(41,151,255,0.16);
}

.at-sign {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-3);
  flex-shrink: 0;
  user-select: none;
  line-height: 1;
}

.u-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.97rem;
  font-weight: 500;
  color: var(--text);
  padding: 15px 0;
  min-width: 0;
}

.u-input::placeholder { color: var(--text-4); font-weight: 400; }

.search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 22px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--t) var(--ease), transform 0.12s, box-shadow var(--t) var(--ease), opacity var(--t) var(--ease);
  box-shadow: 0 2px 8px rgba(0,113,227,0.25);
}

.search-btn:hover  { background: var(--accent-h); box-shadow: 0 4px 16px rgba(0,113,227,0.35); }
.search-btn:active { transform: scale(0.96); }
.search-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.pills-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pills-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-3);
  white-space: nowrap;
}

.pills { display: flex; gap: 6px; }

.pill {
  padding: 5px 15px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-md);
  background: var(--pill-bg);
  color: var(--text-3);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t) var(--ease);
}

.pill:hover { color: var(--text); border-color: var(--border-strong); background: var(--bg-3); }

.pill.active {
  background: var(--pill-on);
  color: var(--pill-on-text);
  border-color: var(--pill-on);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

[data-theme="dark"] .pill.active { box-shadow: 0 2px 8px rgba(0,0,0,0.5); }

.output-section { padding-bottom: 100px; }

.progress-wrap {
  display: none;
  margin-bottom: 28px;
}

.progress-track {
  height: 3px;
  background: var(--bg-3);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #5ac8fa);
  border-radius: 2px;
  transition: width 0.38s var(--ease);
}

.progress-text {
  font-size: 0.77rem;
  color: var(--text-3);
  font-weight: 400;
}

.error-box {
  display: none;
  align-items: center;
  gap: 10px;
  background: var(--red-light);
  border: 1px solid rgba(255,59,48,0.18);
  border-radius: var(--r-sm);
  padding: 13px 16px;
  color: var(--red);
  font-size: 0.84rem;
  font-weight: 500;
  margin-bottom: 24px;
  line-height: 1.4;
}

.error-box.show { display: flex; }

.results-meta {
  display: none;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.results-meta.show { display: flex; }

.meta-left { display: flex; flex-direction: column; gap: 3px; }

.meta-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.015em;
}

.meta-sub {
  font-size: 0.75rem;
  color: var(--text-3);
  font-weight: 400;
}

.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--border-md);
  border-radius: var(--r-pill);
  padding: 7px 14px;
  background: var(--bg-card);
  white-space: nowrap;
  text-decoration: none;
  transition: all var(--t) var(--ease);
  box-shadow: var(--sh-sm);
}

.profile-link:hover { background: var(--accent-light); border-color: rgba(0,113,227,0.25); text-decoration: none; }

.card-list { display: flex; flex-direction: column; gap: 12px; }

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  animation: rise 0.4s var(--ease) both;
  transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t) var(--ease);
  position: relative;
}

.post-card:hover {
  box-shadow: var(--sh-md);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-accent-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, #5ac8fa 60%, var(--green) 100%);
  opacity: 0;
  transition: opacity var(--t) var(--ease);
}

.post-card:first-child .card-accent-bar { opacity: 1; }

.card-body { padding: 20px 22px 18px; }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
  flex-wrap: nowrap;
}

.ordinal-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: var(--r-pill);
  padding: 3px 11px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  background: var(--bg-2);
  color: var(--text-3);
  border: 1px solid var(--border);
}

.ordinal-badge.is-first {
  background: var(--accent-light);
  color: var(--accent);
  border-color: rgba(0,113,227,0.18);
}

[data-theme="dark"] .ordinal-badge.is-first { border-color: rgba(41,151,255,0.22); }

.card-date {
  font-size: 0.7rem;
  color: var(--text-3);
  text-align: right;
  line-height: 1.5;
  white-space: nowrap;
  font-weight: 400;
}

.card-date strong { font-weight: 600; color: var(--text-2); display: block; }

.post-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.015em;
  line-height: 1.38;
  margin-bottom: 14px;
}

.card-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.77rem;
  font-weight: 500;
  color: var(--text-3);
}

.stat svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  opacity: 0.7;
}

.payout-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--green);
  background: var(--green-light);
  border-radius: var(--r-pill);
  padding: 2px 9px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 22px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
}

.permlink-text {
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text-4);
  font-family: 'SF Mono', ui-monospace, 'Fira Code', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 15px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
  transition: background var(--t) var(--ease), transform 0.12s, box-shadow var(--t) var(--ease);
  box-shadow: 0 2px 6px rgba(0,113,227,0.22);
}

.view-btn:hover { background: var(--accent-h); box-shadow: 0 4px 12px rgba(0,113,227,0.35); text-decoration: none; }
.view-btn:active { transform: scale(0.95); }

.view-btn svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px;
  animation: rise 0.3s var(--ease) both;
}

.skel {
  background: var(--skel);
  border-radius: var(--r-xs);
  position: relative;
  overflow: hidden;
}

.skel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, var(--skel-shine) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer { 100% { transform: translateX(100%); } }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 0;
  background: var(--bg-2);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.74rem;
  color: var(--text-3);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-2);
}

.footer-logo-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 5px;
}

.footer-mid a { color: var(--text-3); font-weight: 500; }
.footer-mid a:hover { color: var(--accent); }
.footer-right { color: var(--text-4); }

@media (max-width: 640px) {
  .hero { padding: 56px 0 40px; }
  .hero-h1 { font-size: 2.2rem; }
  .hero-p { font-size: 0.93rem; }
  .hero-badge { font-size: 0.65rem; }

  .search-row { flex-direction: column; gap: 10px; }
  .search-btn { width: 100%; padding: 15px; }

  .card-head { flex-wrap: wrap; gap: 8px; }
  .card-date { text-align: left; }

  .card-footer { flex-direction: column; align-items: flex-start; gap: 10px; }
  .view-btn { width: 100%; justify-content: center; }
  .permlink-text { max-width: 100%; }

  .results-meta { flex-direction: column; align-items: flex-start; gap: 10px; }
  .profile-link { width: 100%; justify-content: center; }

  .footer-inner { flex-direction: column; align-items: center; text-align: center; }
  .logo-caption { display: none; }

  .container { padding: 0 18px; }
}

@media (max-width: 380px) {
  .logo-title { font-size: 0.8rem; }
  .hero-h1 { font-size: 1.9rem; }
}

@media (min-width: 1024px) {
  .hero { padding: 96px 0 60px; }
  .hero-h1 { letter-spacing: -0.04em; }
}

::selection { background: rgba(0,113,227,0.15); }
[data-theme="dark"] ::selection { background: rgba(41,151,255,0.2); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }
