/**
 * article_detail.css - 炼金笔记文章详情页专用样式
 * 
 * @version 0.1.20250520.r1.3
 */

/* 文章详情页样式 */
.article-detail {
  background: rgba(30, 21, 72, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0;
  margin-bottom: 30px;
  overflow: hidden;
}

.article-detail-header {
  padding: 25px;
  background: rgba(20, 11, 46, 0.7);
  border-bottom: 1px solid var(--border-color-light);
}

.article-detail-title {
  font-size: 1.8rem;
  color: var(--primary-light);
  margin-bottom: 15px;
  line-height: 1.3;
}

.article-detail-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.article-author-info {
  display: flex;
  align-items: center;
}

.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(45deg, #c28b37, #daa520);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  color: #140b2e;
  font-weight: bold;
  font-size: 1.1rem;
}

.author-details {
  display: flex;
  flex-direction: column;
}

.author-name {
  color: var(--text-color);
  font-weight: 600;
  font-size: 1rem;
}

.publish-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.article-stats-detail {
  display: flex;
  gap: 15px;
}

.article-stats-detail span {
  display: flex;
  align-items: center;
}

.article-stats-detail i {
  margin-right: 5px;
}

.article-detail-subheader {
  padding: 15px 25px;
  border-bottom: 1px solid var(--border-color-light);
  background: rgba(30, 21, 72, 0.3);
}

.article-summary-box {
  background: rgba(20, 11, 46, 0.5);
  padding: 12px 15px;
  border-radius: 5px;
  border-left: 3px solid var(--primary-color);
  line-height: 1.6;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.article-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.article-detail-content {
  padding: 30px 25px;
  line-height: 1.8;
  font-size: 1rem;
}

/* 文章已删除提示 */
.article-deleted-notice {
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid rgba(255, 68, 68, 0.3);
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  margin: 50px auto;
  max-width: 500px;
}

.article-deleted-notice h2 {
  color: #ff4444;
  margin-bottom: 15px;
}

.article-deleted-notice p {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.article-deleted-notice .back-btn {
  display: inline-block;
  padding: 10px 20px;
  background: linear-gradient(45deg, var(--primary-color), var(--primary-light));
  border-radius: 8px;
  color: var(--bg-dark);
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
}

.article-deleted-notice .back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(194, 139, 55, 0.3);
}

/* Markdown 内容样式 */
.markdown-content h1 {
  font-size: 1.8rem;
  margin: 1.8rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--primary-light);
}

.markdown-content h2 {
  font-size: 1.5rem;
  margin: 1.5rem 0 1rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-color-light);
  color: var(--primary-color);
}

.markdown-content h3 {
  font-size: 1.3rem;
  margin: 1.3rem 0 0.8rem;
  color: var(--primary-color);
}

.markdown-content h4, 
.markdown-content h5, 
.markdown-content h6 {
  margin: 1.2rem 0 0.8rem;
  color: var(--text-color);
}

.markdown-content p {
  margin: 0.8rem 0;
  line-height: 1.8;
}

.markdown-content blockquote {
  padding: 0.5rem 1rem;
  color: var(--text-muted);
  border-left: 0.25rem solid var(--primary-dark);
  margin: 1rem 0;
  background: rgba(20, 11, 46, 0.6);
  border-radius: 0 4px 4px 0;
}

.markdown-content pre {
  background: rgba(20, 11, 46, 0.6);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--border-color-light);
}

.markdown-content code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  padding: 0.2rem 0.4rem;
  background: rgba(20, 11, 46, 0.6);
  border-radius: 3px;
  font-size: 0.9em;
  color: #daa54e;
}

.markdown-content pre code {
  padding: 0;
  background-color: transparent;
  color: var(--text-color);
}

.markdown-content a {
  color: var(--primary-color);
  text-decoration: none;
  border-bottom: 1px dotted var(--primary-color);
  transition: all 0.3s ease;
}

.markdown-content a:hover {
  color: var(--primary-light);
  border-bottom: 1px solid var(--primary-light);
}

.markdown-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
  border: 1px solid var(--border-color);
}

.markdown-content ul,
.markdown-content ol {
  padding-left: 2rem;
  margin: 1rem 0;
}

.markdown-content ul li,
.markdown-content ol li {
  margin-bottom: 0.5rem;
}

.markdown-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5rem 0;
  overflow-x: auto;
  display: block;
}

.markdown-content table th,
.markdown-content table td {
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
}

.markdown-content table th {
  background-color: rgba(20, 11, 46, 0.7);
  font-weight: 600;
  color: var(--primary-color);
}

.markdown-content table tr:nth-child(2n) {
  background-color: rgba(30, 21, 72, 0.3);
}

.markdown-content hr {
  border: 0;
  height: 1px;
  background: var(--border-color);
  margin: 2rem 0;
}

/* 文章操作按钮 */
.article-actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 30px;
}

.action-btn {
  padding: 10px 20px;
  border-radius: 8px;
  background: rgba(20, 11, 46, 0.7);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
}

.action-btn i {
  margin-right: 8px;
}

.action-btn:hover {
  background: rgba(194, 139, 55, 0.2);
  border-color: var(--primary-color);
}

.action-btn.active {
  background: rgba(194, 139, 55, 0.3);
  border-color: var(--primary-color);
  color: var(--primary-light);
}

/* 删除按钮样式 */
.action-btn-danger {
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid rgba(255, 68, 68, 0.3);
  color: #ff4444;
  margin-left: auto; /* 将删除按钮推到右侧 */
}

.action-btn-danger:hover {
  background: rgba(255, 68, 68, 0.2);
  border-color: rgba(255, 68, 68, 0.5);
}

/* 删除确认弹窗 */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 20px;
}

/* 评论区样式 */
.article-comments {
  margin-top: 40px;
}

.comments-title {
  font-size: 1.3rem;
  color: var(--primary-color);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.comment-form {
  display: flex;
  margin-bottom: 30px;
  gap: 15px;
}

.comment-input-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.comment-input-wrapper textarea {
  width: 100%;
  padding: 15px;
  background: rgba(30, 21, 72, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  min-height: 100px;
  resize: vertical;
  margin-bottom: 15px;
}

.comment-input-wrapper textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.comment-input-wrapper button {
  align-self: flex-end;
}

.login-to-comment {
  text-align: center;
  padding: 20px;
  background: rgba(30, 21, 72, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 30px;
}

.login-to-comment a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
}

.login-to-comment a:hover {
  text-decoration: underline;
}

.comments-list {
  margin-top: 20px;
}

.comment-item {
  background: rgba(30, 21, 72, 0.4);
  border: 1px solid var(--border-color-light);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  position: relative; /* 为评论序号定位准备 */
}

.comment-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.comment-author {
  display: flex;
  align-items: center;
  flex: 1;
}

.comment-author-name {
  font-weight: 600;
  color: var(--text-color);
  margin-left: 10px;
}

.comment-time {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.comment-content {
  padding: 5px 0 5px 40px;
  line-height: 1.6;
}

.comment-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 10px;
  padding-left: 40px;
  position: relative; /* 为评论序号定位准备 */
}

.comment-action {
  color: var(--text-muted);
  font-size: 0.85rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  transition: color 0.3s ease;
}

.comment-action:hover {
  color: var(--primary-color);
}

/* 评论序号样式 */
.comment-counter {
  position: absolute;
  bottom: 5px;
  left: 40px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* 评论回复容器 */
.comment-replies {
  margin-top: 15px;
  padding-left: 40px;
}

/* 深层级评论样式 */
.reply-level-1 {
  background: rgba(30, 21, 72, 0.4);
}

.reply-level-2 {
  background: rgba(30, 21, 72, 0.5);
  border-left: 2px solid rgba(194, 139, 55, 0.3);
}

.reply-level-3, 
.reply-level-4, 
.reply-level-5 {
  background: rgba(30, 21, 72, 0.6);
  border-left: 2px solid rgba(194, 139, 55, 0.5);
}

/* 深层级回复容器样式 */
.deep-level-replies {
  border-left: 2px dashed rgba(194, 139, 55, 0.3);
  padding-left: 20px;
  margin-left: 20px;
}

.reply-form {
  display: flex;
  margin: 15px 0 15px 40px;
  gap: 10px;
}

.reply-input-wrapper {
  flex: 1;
  display: flex;
  gap: 10px;
}

.reply-input-wrapper textarea {
  flex: 1;
  padding: 10px;
  background: rgba(30, 21, 72, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  min-height: 60px;
  resize: vertical;
}

.reply-input-wrapper button {
  align-self: flex-end;
  padding: 8px 15px;
  font-size: 0.9rem;
}

.no-comments {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
}

/* 响应式调整 */
@media (max-width: 768px) {
  .article-detail-header {
    padding: 20px;
  }
  
  .article-detail-title {
    font-size: 1.5rem;
  }
  
  .article-detail-content {
    padding: 20px;
  }
  
  .comment-form {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .comment-input-wrapper button {
    align-self: flex-end;
  }
  
  .reply-form {
    flex-direction: column;
    margin-left: 20px;
  }
  
  .comment-content,
  .comment-actions,
  .comment-replies {
    padding-left: 20px;
  }
  
  .deep-level-replies {
    padding-left: 10px;
    margin-left: 10px;
  }
  
  .article-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .action-btn-danger {
    margin-left: 0;
    order: -1; /* 在移动设备上将删除按钮置顶 */
  }
}