/* ============================================
   FinBlog Light — 主样式表
   目标：专业财经博客，简洁、快速、响应式
   ============================================ */

/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial,
    sans-serif;
  line-height: 1.7;
  color: #1a1a2e;
  background: #f8f9fb;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #1d3557;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #457b9d;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.2rem;
}

/* === Header === */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e8ecf1;
  padding: 0.8rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1d3557;
  letter-spacing: -0.5px;
}

.brand:hover {
  color: #1d3557;
}

.main-nav a {
  font-size: 0.9rem;
  color: #6c757d;
  margin-left: 1.5rem;
}

/* === Main Content === */
.main-content {
  flex: 1;
  padding: 2rem 0;
}

/* === Hero (首页) === */
.hero {
  text-align: center;
  padding: 3rem 0 2rem;
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: #1d3557;
  margin-bottom: 0.5rem;
}

.hero-desc {
  color: #6c757d;
  font-size: 1rem;
}

.rss-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #e63946;
  border: 1px solid #e63946;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.rss-link:hover {
  background: #e63946;
  color: white;
}

/* === Article List === */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.article-card {
  display: block;
  background: #ffffff;
  border: 1px solid #e8ecf1;
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.article-card:hover {
  border-color: #a8dadc;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1d3557;
  margin-bottom: 0.4rem;
}

.card-summary {
  color: #555;
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 0.6rem;
}

.card-meta {
  font-size: 0.82rem;
  color: #999;
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.card-meta .category {
  background: #edf2f7;
  color: #4a5568;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.78rem;
}

/* === Single Article === */
.article-page {
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e8ecf1;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.article-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  color: #1d3557;
  line-height: 1.3;
  margin-bottom: 0.8rem;
}

.article-meta {
  font-size: 0.85rem;
  color: #999;
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #edf2f7;
}

.article-meta .tags {
  color: #457b9d;
}

.article-body {
  font-size: 1.02rem;
  line-height: 1.85;
  color: #2d3748;
}

.article-body p {
  margin-bottom: 1rem;
}

.article-body h2 {
  font-size: 1.4rem;
  color: #1d3557;
  margin: 1.8rem 0 1rem;
  padding-top: 0.5rem;
}

.article-body h3 {
  font-size: 1.15rem;
  color: #2d3748;
  margin: 1.5rem 0 0.8rem;
}

.article-body ul, .article-body ol {
  margin: 0.5rem 0 1rem 1.5rem;
}

.article-body blockquote {
  border-left: 4px solid #a8dadc;
  padding: 0.5rem 0 0.5rem 1rem;
  color: #555;
  margin: 1rem 0;
  background: #f7fafc;
  border-radius: 0 4px 4px 0;
}

.article-body pre {
  background: #1a202c;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.article-body code {
  background: #edf2f7;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
}

.article-body pre code {
  background: none;
  padding: 0;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1rem 0;
}

/* === Share Bar === */
.share-bar {
  margin: 1.5rem 0;
  padding: 1rem 0;
  border-top: 1px solid #edf2f7;
  border-bottom: 1px solid #edf2f7;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.share-label {
  font-size: 0.85rem;
  color: #999;
  margin-right: 0.3rem;
}

.share-buttons {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #edf2f7;
  color: #4a5568;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.share-btn:hover {
  background: #457b9d;
  color: white;
  transform: scale(1.1);
}

.share-btn.share-wx {
  background: #e8f5e9;
  color: #2e7d32;
}

.share-btn.share-copy {
  background: #fff3e0;
  color: #e65100;
}

/* === View Counter === */
.view-counter {
  font-size: 0.82rem;
  color: #999;
  margin: 1rem 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.view-counter strong {
  color: #e63946;
  font-size: 1.1rem;
}

/* === Comments Section === */
.comments-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid #e8ecf1;
}

.comments-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1d3557;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.comment-count-badge {
  background: #457b9d;
  color: white;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
}

/* 单条评论 */
.comment-item {
  padding: 1rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.comment-user {
  font-weight: 600;
  font-size: 0.88rem;
  color: #1d3557;
}

.comment-time {
  font-size: 0.78rem;
  color: #bbb;
  margin-left: auto;
}

.comment-floor {
  font-size: 0.75rem;
  color: #999;
  background: #f0f0f0;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

.comment-content {
  font-size: 0.95rem;
  color: #333;
  line-height: 1.6;
  margin: 0.3rem 0 0.3rem 2.5rem;
}

.comment-actions {
  margin: 0.3rem 0 0 2.5rem;
  font-size: 0.78rem;
  color: #aaa;
  display: flex;
  gap: 0.8rem;
}

.comment-actions .like-btn {
  cursor: pointer;
  color: #999;
  transition: color 0.2s;
}

.comment-actions .like-btn:hover {
  color: #e63946;
}

/* 楼中楼回复 */
.comment-replies {
  margin-left: 2.5rem;
  padding-left: 1rem;
  border-left: 2px solid #edf2f7;
  margin-top: 0.5rem;
}

.comment-replies .comment-item {
  padding: 0.6rem 0;
}

.reply-to-label {
  font-size: 0.8rem;
  color: #457b9d;
  margin-right: 0.5rem;
}

/* 评论输入框 */
.comment-form {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #edf2f7;
}

#comment-input {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.2s;
}

#comment-input:focus {
  outline: none;
  border-color: #457b9d;
}

.btn-comment {
  margin-top: 0.5rem;
  padding: 0.6rem 1.5rem;
  background: #1d3557;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-comment:hover {
  background: #457b9d;
}

/* === Footer === */
.site-footer {
  background: #ffffff;
  border-top: 1px solid #e8ecf1;
  padding: 1.2rem 0;
  text-align: center;
  font-size: 0.82rem;
  color: #999;
  margin-top: auto;
}

/* === Toast / Modal === */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: #1d3557;
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-size: 0.88rem;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

/* 隐藏评论数据代码块（JS 已提取，无需显示） */
code[class*="finblog-comments"],
pre:has(code[class*="finblog-comments"]) {
  display: none !important;
}

/* 微信分享弹窗 */
.wechat-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.wechat-modal.active {
  display: flex;
}

.wechat-modal-content {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  max-width: 300px;
}

.wechat-modal-content p {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #555;
}

.wechat-modal-close {
  margin-top: 1rem;
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 0.85rem;
}

/* === Responsive === */
@media (max-width: 640px) {
  .hero h1 {
    font-size: 1.6rem;
  }

  .article-page {
    padding: 1.2rem;
  }

  .article-header h1 {
    font-size: 1.4rem;
  }

  .article-body {
    font-size: 0.95rem;
  }

  .share-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .comments-section {
    padding: 0;
  }
}
