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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #000;
  color: #e7e9ea;
  min-height: 100vh;
}

a { color: #1d9bf0; text-decoration: none; }
a:hover { text-decoration: underline; }

.app {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 275px;
  padding: 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.sidebar-spacer { flex: 1; }

.logo {
  padding: 12px;
  color: #e7e9ea;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px;
  border-radius: 9999px;
  font-size: 20px;
  transition: background 0.2s;
  color: inherit;
  text-decoration: none;
}

.nav-item:hover { background: #181818; text-decoration: none; }
.nav-item.active { font-weight: 700; }
.nav-item span { display: inline; }

/* Platform badge */
.platform-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(29, 155, 240, 0.1);
  border: 1px solid rgba(29, 155, 240, 0.3);
  border-radius: 16px;
  margin-top: 8px;
}

.badge-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1d9bf0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.badge-text {
  display: flex;
  flex-direction: column;
}

.badge-label {
  font-weight: 700;
  font-size: 15px;
  color: #1d9bf0;
}

.badge-sub {
  font-size: 13px;
  color: #71767b;
}

.sidebar-info {
  padding: 12px 8px;
  font-size: 13px;
  color: #71767b;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Timeline */
.timeline {
  flex: 1;
  max-width: 600px;
  border-left: 1px solid #2f3336;
  border-right: 1px solid #2f3336;
  min-height: 100vh;
}

.timeline-header {
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  z-index: 10;
  border-bottom: 1px solid #2f3336;
}

.timeline-header h2 {
  padding: 12px 16px;
  font-size: 20px;
}

.tabs {
  display: flex;
}

.tab {
  flex: 1;
  background: none;
  border: none;
  color: #71767b;
  padding: 16px;
  font-size: 15px;
  cursor: default;
  position: relative;
  font-weight: 500;
}

.tab.active {
  color: #e7e9ea;
  font-weight: 700;
}
.tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 4px;
  background: #1d9bf0;
  border-radius: 2px;
}

/* Avatar */
.avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1d9bf0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.avatar-placeholder.small {
  width: 28px;
  height: 28px;
  font-size: 13px;
}

/* Posts */
.post {
  display: flex;
  padding: 12px 16px;
  border-bottom: 1px solid #2f3336;
  gap: 12px;
  transition: background 0.2s;
}

.post:hover { background: rgba(255, 255, 255, 0.03); }

.post-avatar {
  flex-shrink: 0;
}

.post-avatar .avatar-placeholder {
  font-size: 16px;
}

.post-body { flex: 1; min-width: 0; }

.post-header {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.post-author {
  font-weight: 700;
  font-size: 15px;
}

.post-handle {
  color: #71767b;
  font-size: 15px;
}

.post-time {
  color: #71767b;
  font-size: 15px;
}

.post-time::before {
  content: '\00b7';
  margin: 0 4px;
}

.post-content {
  font-size: 15px;
  line-height: 1.4;
  margin-top: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Quote card */
.quote-card {
  display: block;
  margin-top: 12px;
  border: 1px solid #2f3336;
  border-radius: 16px;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}

.quote-card:hover {
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
}

.quote-header {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.quote-author {
  font-weight: 700;
  font-size: 13px;
}

.quote-handle {
  color: #71767b;
  font-size: 13px;
}

.quote-source {
  color: #71767b;
  font-size: 12px;
  margin-left: auto;
}

.quote-text {
  font-size: 14px;
  line-height: 1.4;
  color: #e7e9ea;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-actions {
  display: flex;
  justify-content: space-between;
  max-width: 425px;
  margin-top: 12px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #71767b;
  font-size: 13px;
  padding: 4px;
}

.stat-item.reply {
  cursor: pointer;
  border-radius: 9999px;
  transition: color 0.2s;
}

.stat-item.reply:hover { color: #1d9bf0; }

/* Comments — threaded */
.comments-section {
  margin-top: 8px;
  border-top: 1px solid #2f3336;
  padding-top: 4px;
}

.comment-thread {
  position: relative;
}

.comment-thread.comment-nested {
  margin-left: 20px;
}

.comment {
  display: flex;
  gap: 8px;
  padding: 8px 0 4px;
}

.comment-left {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.thread-line {
  width: 2px;
  flex: 1;
  background: #2f3336;
  margin-top: 4px;
  min-height: 8px;
  border-radius: 1px;
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

.comment-header .post-author { font-size: 13px; }
.comment-header .post-handle { font-size: 13px; }
.comment-header .post-time { font-size: 13px; }

.comment-content {
  font-size: 14px;
  line-height: 1.3;
  margin-top: 2px;
  white-space: pre-wrap;
  word-break: break-word;
}

.thread-show-more {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #1d9bf0;
  font-size: 13px;
  padding: 6px 0 6px 20px;
  cursor: pointer;
  transition: color 0.2s;
}

.thread-show-more:hover {
  color: #1a8cd8;
  text-decoration: underline;
}

.thread-show-more svg {
  color: #1d9bf0;
}

.comment-replies {
  position: relative;
}

.no-comments {
  font-size: 13px;
  color: #71767b;
  padding: 8px 0;
}

.comment-error {
  font-size: 13px;
  color: #f4212e;
  padding: 8px 0;
}

/* Loading */
.loading {
  display: flex;
  justify-content: center;
  padding: 20px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #2f3336;
  border-top-color: #1d9bf0;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.end-message {
  text-align: center;
  padding: 20px;
  color: #71767b;
  font-size: 15px;
}

/* Right sidebar — API Guide */
.sidebar-right {
  width: 420px;
  padding: 12px 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.guide-box {
  background: #16181c;
  border-radius: 16px;
  padding: 16px;
}

.guide-box h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.guide-intro {
  font-size: 14px;
  color: #71767b;
  line-height: 1.5;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #2f3336;
}

.guide-section {
  margin-bottom: 16px;
}

.guide-section h4 {
  font-size: 15px;
  color: #e7e9ea;
  margin-bottom: 8px;
}

.code-block {
  display: block;
  background: #000;
  border: 1px solid #2f3336;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  color: #7dd3fc;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
  margin-bottom: 6px;
}

.guide-note {
  font-size: 13px;
  color: #71767b;
  line-height: 1.4;
  margin-top: 4px;
}

.guide-note code {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  background: rgba(29, 155, 240, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
  color: #7dd3fc;
}

.guide-tip {
  background: rgba(29, 155, 240, 0.05);
  border: 1px solid rgba(29, 155, 240, 0.15);
  border-radius: 12px;
  padding: 12px 16px;
}

.guide-tip h4 {
  color: #1d9bf0;
}

.guide-tip ul {
  list-style: none;
  padding: 0;
}

.guide-tip ul li {
  font-size: 13px;
  color: #71767b;
  line-height: 1.5;
  padding: 4px 0;
  padding-left: 16px;
  position: relative;
}

.guide-tip ul li::before {
  content: '\2022';
  position: absolute;
  left: 0;
  color: #1d9bf0;
}

/* Responsive */
@media (max-width: 1200px) {
  .sidebar-right { width: 350px; }
}

@media (max-width: 1080px) {
  .sidebar-right { display: none; }
}

@media (max-width: 768px) {
  .sidebar {
    width: 68px;
    align-items: center;
  }
  .nav-item span { display: none; }
  .platform-badge { display: none; }
  .sidebar-info { display: none; }
}
