:root {
  --bg: #eef3f8;
  --panel: #ffffff;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #64748b;
  --line: #d9e2ec;
  --link: #0a66c2;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius: 18px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: linear-gradient(180deg, #f7fafc 0%, #eef3f8 260px);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }
.hero { padding: 28px 0 18px; }
.hero-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.hero h1 { margin: 0 0 6px; font-size: 2rem; line-height: 1.15; }
.hero .handle { margin: 0; color: rgba(255,255,255,0.82); font-size: 1rem; }
.hero-intro { margin-top: 16px; color: rgba(255,255,255,0.95); }
.bio-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.profile-image {
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.18);
  flex: 0 0 56px;
}
.bio-copy {
  min-width: 0;
}
.hero-intro + .hero-intro { margin-top: 10px; }
.bio-panel {
  margin-top: 16px;
  padding: 18px 20px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  color: rgba(255,255,255,0.95);
}
.bio-panel h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: rgba(255,255,255,0.8);
}
.bio-meta {
  margin-top: 14px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.bio-meta a {
  color: inherit;
  text-decoration: none;
}
.toolbar-wrap {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 14px 0 20px;
  margin-bottom: 10px;
  backdrop-filter: blur(8px);
  background: rgba(238, 243, 248, 0.82);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.toolbar {
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
  padding: 14px;
}
.search-box {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 1rem;
  background: #fff;
  color: var(--text);
}
.search-box:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}
.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}
select, button {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  color: var(--text);
}
button { cursor: pointer; }
.count {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}
.content { padding: 6px 0 40px; }
.tweet-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.tweet-meta {
  color: var(--muted);
  font-size: 0.98rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.tweet-meta .handle {
  font-weight: 700;
  color: #475569;
}
.replying {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}
.tweet-text {
  margin: 14px 0 0;
  font-size: 1rem;
  overflow-wrap: anywhere;
}
.media {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.media img, .media video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #e5e7eb;
}
.tweet-links {
  margin-top: 14px;
  font-size: 0.95rem;
}
.footer {
  color: var(--muted);
  font-size: 0.95rem;
  padding: 8px 0 40px;
}
.empty-state {
  padding: 32px 24px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255,255,255,0.7);
}
.loading, .notice {
  color: var(--muted);
  padding: 12px 0;
}
.error-box {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid #fca5a5;
  border-radius: 14px;
  background: #fff1f2;
  color: #7f1d1d;
}
mark {
  background: #fde68a;
  color: inherit;
  padding: 0 0.1em;
  border-radius: 0.2em;
}
@media (max-width: 640px) {
  .hero-card { padding: 22px; border-radius: 20px; }
  .tweet-card { padding: 18px; }
  .hero h1 { font-size: 1.65rem; }
}
