/* Article page */
.article-page .main { max-width: 720px; }
.article-page-body { padding-bottom: 0; }

.article-progress {
  position: fixed; top: var(--header-height); left: 0; height: 3px;
  background: var(--color-accent); width: 0; z-index: 99;
  transition: width 0.1s linear; pointer-events: none;
}

.article-full {
  background: var(--color-bg-card); border-radius: var(--radius);
  padding: 24px 20px; box-shadow: var(--shadow-card); margin-bottom: 20px;
}
.article-header { margin-bottom: 12px; }
.article-header .content-header { margin-bottom: 0; }
.article-header__actions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
  padding-top: 12px; border-top: 1px solid #f0f2f5;
}
.article-header__actions .profile-btn span { white-space: nowrap; }

.article-full .content-title {
  font-family: var(--font-sans);
  font-size: 28px; line-height: 1.22; margin-bottom: 16px;
  letter-spacing: -0.03em; font-weight: 700;
}
.article-cover {
  margin: 0 0 20px; border-radius: 12px; overflow: hidden; background: #eef0f2;
}
.article-cover img {
  width: 100%; max-height: 420px; object-fit: cover; display: block;
}
.article-full .content-body,
.article-full .article-body {
  font-family: var(--font-serif);
  font-size: 18px; line-height: 1.75; color: #1a1a1a;
  letter-spacing: 0.01em;
}
.article-full .content-body h2, .article-full .article-body h2 {
  font-family: var(--font-sans);
  font-size: 22px; margin: 32px 0 14px; font-weight: 700; letter-spacing: -0.02em;
}
.article-full .content-body h3, .article-full .article-body h3 {
  font-family: var(--font-sans);
  font-size: 19px; margin: 24px 0 10px; font-weight: 600;
}
.article-full .content-body p, .article-full .article-body p { margin-bottom: 18px; }
.article-full .content-body ul, .article-full .content-body ol,
.article-full .article-body ul, .article-full .article-body ol {
  margin: 0 0 18px 24px;
}
.article-full .content-body li, .article-full .article-body li { margin-bottom: 8px; }
.article-full .content-body img, .article-full .article-body img,
.article-full .content-body .article-figure img, .article-full .article-body .article-figure img {
  max-width: 100%; height: auto; border-radius: 12px; margin: 20px 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.article-full .content-body .article-figure, .article-full .article-body .article-figure {
  margin: 20px 0;
}
.article-full .content-body blockquote, .article-full .article-body blockquote {
  border-left: 3px solid var(--color-accent); padding: 10px 0 10px 20px;
  margin: 24px 0; color: var(--color-text-secondary); font-style: italic;
  font-size: 17px;
}
.article-full .content-body a, .article-full .article-body a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 2px; }

.article-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px;
  padding-top: 16px; border-top: 1px solid #f0f2f5;
}
.article-toolbar__btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 20px; border: 1px solid var(--color-border);
  font-size: 13px; font-weight: 500; color: var(--color-text-secondary);
  background: #fff; transition: 0.12s;
}
.article-toolbar__btn:hover { background: #f5f6f8; color: #1a1a1a; }
.bookmark-btn--active { color: var(--color-accent) !important; border-color: #c5d9ff !important; background: #f0f6ff !important; }

.related-articles {
  background: var(--color-bg-card); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-card); margin-bottom: 20px;
  border: 1px solid var(--color-border);
}
.related-articles__title { font-size: 17px; font-weight: 600; margin-bottom: 12px; }
.related-articles__list { display: flex; flex-direction: column; gap: 8px; }
.related-articles__item {
  display: block; padding: 12px 14px; border-radius: 10px;
  border: 1px solid #f0f2f5; transition: 0.12s;
}
.related-articles__item:hover { background: #f8f9fb; border-color: var(--color-border); }
.related-articles__item-title {
  display: block; font-size: 15px; font-weight: 500; line-height: 1.35; margin-bottom: 4px;
}
.related-articles__item-meta { font-size: 12px; color: var(--color-text-secondary); }

.article-mobile-bar {
  display: none;
}

.comments-section {
  background: var(--color-bg-card); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-card); margin-bottom: 20px;
}
.comments-section__title {
  font-size: 18px; font-weight: 600; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.comments-section__count {
  font-size: 14px; color: var(--color-text-secondary); font-weight: 400;
}

.comment-form { margin-bottom: 24px; }
.comment-form textarea {
  width: 100%; min-height: 80px; padding: 12px 14px;
  border: 1px solid var(--color-border); border-radius: 10px;
  font-family: inherit; font-size: 15px; resize: vertical;
}
.comment-form textarea:focus { outline: none; border-color: var(--color-accent); }
.comment-form__actions {
  display: flex; gap: 8px; margin-top: 8px; align-items: center; flex-wrap: wrap;
}
.comment-form__btn {
  padding: 10px 20px; background: var(--color-accent); color: #fff;
  border-radius: 20px; font-size: 14px; font-weight: 500;
}
.comment-form__btn:disabled { opacity: 0.6; cursor: not-allowed; }
.comment-form__attach {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 12px; color: var(--color-text-secondary); font-size: 14px;
  border-radius: 20px; cursor: pointer; transition: background 0.12s, color 0.12s;
  user-select: none;
}
.comment-form__attach:hover {
  background: #f0f2f5; color: #1a1a1a;
}
.comment-form__attach-status {
  font-size: 13px; color: var(--color-text-secondary);
}
.comment-form__preview {
  position: relative; display: inline-block; margin-top: 10px;
  border-radius: 10px; overflow: hidden; max-width: 220px;
  border: 1px solid var(--color-border);
}
.comment-form__preview img {
  display: block; max-width: 220px; max-height: 160px; object-fit: cover;
}
.comment-form__preview-remove {
  position: absolute; top: 6px; right: 6px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,0.55); color: #fff; font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}

.comment {
  padding: 12px 0; border-bottom: 1px solid #f0f2f5;
  margin-left: calc(var(--depth, 0) * 24px);
  position: relative;
}
.comment:last-child { border-bottom: 0; }
.comment__header { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.comment__meta { flex: 1; min-width: 0; }
.comment__author { font-weight: 500; font-size: 14px; }
.comment__time { font-size: 12px; color: var(--color-text-secondary); }
.comment__body { font-size: 15px; line-height: 1.5; margin-bottom: 8px; word-break: break-word; }
.comment__image { max-width: 100%; border-radius: 8px; margin: 8px 0; }
.comment__actions { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.comment__action {
  font-size: 13px; color: var(--color-text-secondary); transition: color 0.1s;
}
.comment__action:hover { color: #1a1a1a; }
.comment__children { margin-top: 8px; }

.comment--hidden { filter: blur(4px); pointer-events: none; user-select: none; }
.comment-plus-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.85); z-index: 2; border-radius: 8px;
  pointer-events: auto; filter: none;
}
.comment-plus-overlay p { font-size: 14px; text-align: center; padding: 16px; }
.comment-plus-overlay a { color: var(--color-accent); font-weight: 500; }

.plus-banner {
  background: var(--plus-gradient);
  color: var(--plus-text);
  border: 1px solid var(--plus-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
}
.plus-banner__text { flex: 1; min-width: 0; }
.plus-banner__text h3 { font-size: 16px; margin-bottom: 4px; color: var(--plus-text); }
.plus-banner__text p { font-size: 13px; color: #3d5a80; }
.plus-banner__btn {
  padding: 10px 20px;
  background: var(--plus-bg);
  color: var(--plus-text);
  border: 1px solid var(--plus-border);
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.plus-banner__btn:hover {
  background: var(--plus-bg-hover);
  border-color: rgba(70, 132, 217, 0.5);
}

.reaction-picker {
  display: none; position: absolute; background: #fff;
  border-radius: 30px; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 6px 10px; gap: 4px; z-index: 50;
}
.reaction-picker.is-open { display: flex; }
.reaction-picker button { font-size: 22px; padding: 4px; transition: transform 0.1s; }
.reaction-picker button:hover { transform: scale(1.2); }

@media (max-width: 767px) {
  .article-page .layout { padding: 0; }
  .article-page .main { max-width: none; padding: 0 0 80px; }
  .article-page .sidebar { display: none; }
  .article-page .right-sidebar { display: none !important; }

  .article-progress { top: 0; }

  .article-full {
    border-radius: 0; padding: 16px 14px; margin-bottom: 12px;
    box-shadow: none; border-bottom: 1px solid var(--color-border);
  }
  .article-full .content-title { font-size: 22px; line-height: 1.3; }
  .article-full .content-body { font-size: 16px; line-height: 1.65; }
  .article-full .content-body h2 { font-size: 19px; }
  .article-full .content-body h3 { font-size: 17px; }

  .article-header__actions { gap: 6px; }
  .article-header__actions .profile-btn {
    flex: 1; justify-content: center; padding: 8px 10px; font-size: 13px;
  }

  .article-toolbar { display: none; }

  .article-mobile-bar {
    display: flex; position: fixed; bottom: var(--tabbar-height); left: 0; right: 0;
    background: rgba(255,255,255,0.96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--color-border); z-index: 90;
    padding: 6px 8px; gap: 4px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .article-mobile-bar__btn {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    gap: 2px; padding: 6px 4px; font-size: 10px; color: var(--color-text-secondary);
    border-radius: 8px; min-width: 0;
  }
  .article-mobile-bar__btn:hover,
  .article-mobile-bar__btn.bookmark-btn--active { color: var(--color-accent); }
  .article-mobile-bar__btn svg { width: 20px; height: 20px; }

  .comments-section {
    border-radius: 0; margin-bottom: 0; padding: 16px 14px;
    box-shadow: none;
  }
  .comment { margin-left: calc(var(--depth, 0) * 12px); }
  .comment__actions { gap: 6px 10px; }

  .plus-banner {
    border-radius: 0; margin-bottom: 12px; flex-direction: column; text-align: center;
  }
  .plus-banner__btn { width: 100%; text-align: center; }

  .related-articles {
    border-radius: 0; margin-bottom: 12px; border-left: none; border-right: none;
  }

  .article-page-body { padding-bottom: calc(var(--tabbar-height) + 52px); }
  .article-page-body .floating-write { bottom: calc(var(--tabbar-height) + 60px); }
}

@media (min-width: 768px) {
  .article-mobile-bar { display: none !important; }
}
