* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: #f5f5f5;
  color: #1f1f1f;
  max-width: 390px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

button {
  font: inherit;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

.powered-banner {
  background: linear-gradient(90deg, #7e22ce, #3b82f6);
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #ffffff;
}

.powered-banner .left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.powered-banner .right {
  display: flex;
  align-items: center;
}

.link-button {
  color: #ffffff;
  text-decoration: underline;
  font-size: 12px;
  opacity: 0.9;
}

.link-button:hover {
  opacity: 1;
}

.connect-hint {
  opacity: 0.7;
  font-size: 12px;
}

.header {
  background: #ffffff;
  border-bottom: 1px solid #e5e5e5;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header h1 {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
}

.main-content {
  padding: 16px;
  overflow-y: auto;
  min-height: calc(100vh - 120px);
}

.nav-hint-toast {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff1b8, #ffe7ba);
  border: 1px solid #ffd666;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #5c3d14;
}

.nav-hint-icon {
  font-size: 18px;
  line-height: 1;
}

.nav-hint-text {
  flex: 1;
  font-weight: 600;
}


.section-title {
  font-size: 12px;
  font-weight: 500;
  color: #666666;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-item,
.all-posts-item {
  width: 100%;
  text-align: left;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.category-item:hover,
.all-posts-item:hover {
  background-color: #f9f9f9;
}

.category-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.category-icon {
  font-size: 18px;
}

.category-name {
  font-weight: 500;
  font-size: 16px;
}

.category-count {
  margin-left: auto;
  color: #666666;
  font-size: 14px;
  min-width: 32px;
  text-align: right;
}

.chevron {
  color: #999999;
  font-size: 18px;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tag {
  background: #f0f0f0;
  color: #666666;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.tag:hover {
  background: #e0e0e0;
}

.spacer {
  height: 64px;
}

.post-item {
  width: 100%;
  text-align: left;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.post-item:hover {
  background-color: #f9f9f9;
}

.post-title {
  font-weight: 500;
  font-size: 16px;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.post-tag {
  background: #f0f0f0;
  color: #666666;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.post-date {
  color: #999999;
  font-size: 14px;
}

.connect-screen {
  padding-bottom: 24px;
}

.connect-content {
  padding: 16px;
  min-height: calc(100vh - 60px);
}

.connect-header {
  text-align: center;
  margin-bottom: 32px;
}

.connect-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(90deg, #7e22ce, #3b82f6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: #ffffff;
  font-size: 32px;
}

.connect-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.connect-description {
  color: #666666;
  line-height: 1.5;
}

.feature-item {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: #f0f7ff;
  border-radius: 12px;
  margin-bottom: 16px;
}

.feature-icon {
  width: 32px;
  height: 32px;
  background: #dbeafe;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3b82f6;
  flex-shrink: 0;
}

.feature-content h3 {
  font-weight: 600;
  margin-bottom: 4px;
}

.feature-content p {
  color: #666666;
  font-size: 14px;
  line-height: 1.4;
}

.connect-button {
  width: 100%;
  padding: 16px;
  background: linear-gradient(90deg, #7e22ce, #3b82f6);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 24px;
  box-shadow: 0 4px 12px rgba(126, 34, 206, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.connect-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(126, 34, 206, 0.4);
}

.back-button {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.back-button span {
  color: #666666;
  font-size: 18px;
  line-height: 1;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.posts-screen .header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.posts-screen .header h1 {
  text-align: left;
  flex: 1;
}

.empty-state {
  padding: 16px;
  text-align: center;
  color: #666666;
}

.categories-footer {
  margin-bottom: 8px;
}

.posts-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.load-more-button {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #d4d4d8;
  background: #ffffff;
  color: #1f1f1f;
  font-weight: 600;
  cursor: pointer;
}

.load-more-button:disabled {
  opacity: 0.7;
  cursor: default;
}

.load-more-error {
  margin-top: 0;
}
