/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #ffffff;
  color: #1a1a1a;
  line-height: 1.6;
  font-size: 16px;
}

/* Top Search Bar */
.top-search {
  background: #ffffff;
  border-bottom: 1px solid #e5e5e5;
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.search-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-label {
  color: #666;
  font-size: 14px;
}

.search-shortcut {
  color: #999;
  font-size: 12px;
  background: #f5f5f5;
  padding: 4px 8px;
  border-radius: 4px;
}

/* Main Layout */
.main-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 30px;
}

/* Article Content */
.article-content {
  min-width: 0; /* Prevents overflow */
}

.article-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5e5e5;
}

.article-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.3;
  color: #1a1a1a;
  margin-bottom: 15px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #666;
  flex-wrap: wrap;
}

.meta-separator {
  color: #999;
}

.meta-badge {
  background: #e8f4fd;
  color: #0066cc;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.meta-fire {
  color: #ff4444;
  font-size: 16px;
}

/* Article Body */
.article-body {
  font-size: 17px;
  line-height: 1.8;
  color: #333;
}

/* Article Images */
.article-image-wrapper {
  margin: 30px 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.article-main-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.article-main-image:hover {
  transform: scale(1.02);
}

.bot-image-wrapper {
  margin: 15px 0 20px 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.bot-image {
  width: 100%;
  height: auto;
  display: block;
  max-height: 400px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.bot-image:hover {
  transform: scale(1.03);
}

.article-subtitle {
  font-size: 24px;
  font-weight: 700;
  margin: 40px 0 20px 0;
  color: #1a1a1a;
  line-height: 1.4;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  margin: 50px 0 20px 0;
  color: #1a1a1a;
  line-height: 1.4;
}

.subsection-title {
  font-size: 20px;
  font-weight: 600;
  margin: 35px 0 15px 0;
  color: #1a1a1a;
}

.article-body p {
  margin-bottom: 20px;
  text-align: justify;
}

.article-link {
  color: #0066cc;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.article-link:hover {
  border-bottom-color: #0066cc;
}

/* Bot Cards */
.bot-card {
  background: #f9f9f9;
  border-left: 4px solid #0066cc;
  padding: 20px;
  margin: 30px 0;
  border-radius: 4px;
}

.bot-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #1a1a1a;
}

.bot-link {
  margin-bottom: 15px;
}

/* Lists */
.steps-list,
.features-list {
  margin: 20px 0;
  padding-left: 25px;
}

.steps-list li,
.features-list li {
  margin-bottom: 15px;
  line-height: 1.7;
}

/* FAQ */
.faq-item {
  margin: 25px 0;
  padding: 20px;
  background: #fafafa;
  border-radius: 8px;
}

.faq-question {
  font-weight: 600;
  margin-bottom: 10px;
  color: #1a1a1a;
}

.faq-answer {
  color: #555;
}

/* Tags */
.article-tags {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid #e5e5e5;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  background: #e8f4fd;
  color: #0066cc;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 500;
}

/* Sidebar */
.article-sidebar {
  position: sticky;
  top: 60px;
  height: fit-content;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}

/* Author Card */
.author-card {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
  text-align: center;
}

.author-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto 15px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #e5e5e5;
  transition: border-color 0.3s ease;
}

.author-avatar:hover {
  border-color: #0066cc;
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 5px;
  color: #1a1a1a;
}

.author-title {
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
}

.author-stats {
  display: flex;
  justify-content: center;
  gap: 15px;
  font-size: 13px;
  color: #999;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.author-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-primary {
  background: #0066cc;
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #0052a3;
}

.btn-secondary {
  background: #f5f5f5;
  color: #666;
  border: none;
  padding: 10px 15px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #e5e5e5;
}

/* Other Posts */
.other-posts {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 20px;
}

.sidebar-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #1a1a1a;
}

.post-preview {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s;
}

.post-preview:hover {
  background-color: #f9f9f9;
  border-radius: 8px;
  padding: 12px;
  margin-left: -12px;
  margin-right: -12px;
  margin-top: -12px;
  margin-bottom: 8px;
}

.post-preview:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.post-thumbnail {
  flex-shrink: 0;
  width: 120px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  background: #f9f9f9;
  position: relative;
}

.post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-thumbnail img[src=""],
.post-thumbnail img:not([src]) {
  display: none;
}

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

.post-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #1a1a1a;
}

.post-domain {
  font-size: 12px;
  color: #666;
  font-weight: 400;
}

.post-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #999;
}

/* Mobile Responsive */
@media (max-width: 968px) {
  .main-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 15px;
  }

  .article-sidebar {
    position: static;
    max-height: none;
  }

  .article-title {
    font-size: 26px;
  }

  .article-subtitle {
    font-size: 20px;
  }

  .section-title {
    font-size: 20px;
  }

  .article-body {
    font-size: 16px;
  }

  .top-search {
    padding: 10px 15px;
  }

  .search-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .article-body p {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .main-layout {
    padding: 10px;
  }

  .article-title {
    font-size: 22px;
    line-height: 1.2;
  }

  .article-subtitle {
    font-size: 18px;
  }

  .section-title {
    font-size: 18px;
  }

  .subsection-title {
    font-size: 17px;
  }

  .article-body {
    font-size: 15px;
    line-height: 1.7;
  }

  .article-body p {
    text-align: left;
    margin-bottom: 16px;
  }

  .article-image-wrapper {
    margin: 20px 0;
  }

  .bot-image-wrapper {
    margin: 12px 0 15px 0;
  }

  .bot-image {
    max-height: 250px;
  }

  .bot-card {
    padding: 15px;
    margin: 20px 0;
  }

  .bot-title {
    font-size: 17px;
    line-height: 1.3;
  }

  .author-card {
    padding: 15px;
  }

  .author-stats {
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
  }

  .author-actions {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    padding: 12px 20px;
  }

  .post-preview {
    flex-direction: column;
  }

  .post-thumbnail {
    width: 100%;
    height: 180px;
  }
  
  .other-posts {
    margin-top: 20px;
  }

  .article-meta {
    font-size: 13px;
    gap: 8px;
  }

  .meta-badge {
    font-size: 11px;
    padding: 3px 8px;
  }

  .faq-item {
    padding: 15px;
  }

  .faq-question,
  .faq-answer {
    font-size: 15px;
  }

  .steps-list,
  .features-list {
    padding-left: 20px;
  }

  .steps-list li,
  .features-list li {
    margin-bottom: 12px;
    font-size: 15px;
  }

  .tag {
    font-size: 13px;
    padding: 5px 10px;
  }

  .other-posts {
    padding: 15px;
  }

  .sidebar-title {
    font-size: 15px;
  }
}

/* Scrollbar Styling */
.article-sidebar::-webkit-scrollbar {
  width: 6px;
}

.article-sidebar::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 3px;
}

.article-sidebar::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.article-sidebar::-webkit-scrollbar-thumb:hover {
  background: #999;
}

@media (max-width: 768px) {
  body {
    font-size: 14px;
  }
  
  .article-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
  
  .article-content p {
    word-break: break-word;
    hyphens: auto;
  }
  
  .article-content h2,
  .article-content h3 {
    word-break: break-word;
    hyphens: auto;
  }
}


/* Cross-links block structure (TenChat sidebar) */
.other-articles {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 20px;
}

.other-articles .article-preview {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s;
}

.other-articles .article-preview:hover {
  background-color: #f9f9f9;
  border-radius: 8px;
  padding: 12px;
  margin-left: -12px;
  margin-right: -12px;
  margin-top: -12px;
  margin-bottom: 8px;
}

.other-articles .article-preview:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.other-articles .article-link {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  width: 100%;
}

.other-articles .article-thumbnail {
  flex-shrink: 0;
  width: 120px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  background: #f9f9f9;
  position: relative;
}

.other-articles .article-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.other-articles .article-info {
  flex: 1;
  min-width: 0;
}

.other-articles .article-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #1a1a1a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.other-articles .article-description {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.other-articles .article-domain {
  font-size: 12px;
  color: #666;
  font-weight: 400;
  display: block;
}
