/* --------------------------------------------
   Markdown & Article Detail Styles
   -------------------------------------------- */
.article-detail { padding: 0 0 1rem; }
.article-detail .article-header { margin-bottom: 1rem; }
.article-detail .article-title { margin: 0 0 0.5rem; line-height: 1.3; }
.article-detail .article-meta { color: #6b7280; font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.article-detail .article-tags .badge { border-radius: 999px; }

.article-detail .article-content { color: #111827; line-height: 1.8; font-size: 1rem; word-break: break-word; }
.article-detail .article-content > *:first-child { margin-top: 0; }

/* Headings rhythm and anchor offset */
.article-detail .article-content h1,
.article-detail .article-content h2,
.article-detail .article-content h3,
.article-detail .article-content h4,
.article-detail .article-content h5,
.article-detail .article-content h6 { margin-top: 1.6em; margin-bottom: 0.6em; line-height: 1.25; scroll-margin-top: 72px; }

.article-detail .article-content p { margin: 0.85em 0; }
.article-detail .article-content hr { border: 0; border-top: 1px solid #e5e7eb; margin: 1.5rem 0; }

/* Links */
.article-detail .article-content a { color: #1e3a8a; text-decoration: none; border-bottom: 1px dashed rgba(30,58,138,0.35); }
.article-detail .article-content a:hover { text-decoration: underline; }

/* Lists */
.article-detail .article-content ul,
.article-detail .article-content ol { padding-left: 1.25rem; margin: 0.75rem 0; }
.article-detail .article-content li { margin: 0.25rem 0; }

/* Blockquote */
.article-detail .article-content blockquote { margin: 1rem 0; padding: 0.75rem 1rem; background: #f8fafc; border-left: 4px solid #1e3a8a; color: #374151; border-radius: 0.25rem; }

/* Inline code */
.article-detail .article-content code { background: #f3f4f6; padding: 0.15em 0.35em; border-radius: 0.25rem; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.95em; }

/* Code blocks */
.article-detail .article-content pre.code-block { background: #0f172a; color: #e5e7eb; padding: 1rem; border-radius: 0.5rem; overflow: auto; border: 1px solid rgba(255,255,255,0.08); box-shadow: 0 2px 8px rgba(0,0,0,0.08) inset; }
.article-detail .article-content pre.code-block code { background: transparent; padding: 0; color: inherit; white-space: pre; display: block; }

/* Simple token colors to pair with MarkdownRenderer.highlightCode */
.article-detail .article-content .token-kw { color: #93c5fd; font-weight: 600; }
.article-detail .article-content .token-str { color: #a7f3d0; }
.article-detail .article-content .token-num { color: #f9a8d4; }
.article-detail .article-content .token-cmt { color: #9ca3af; font-style: italic; }
.article-detail .article-content .token-key { color: #fca5a5; }

/* Tables */
.article-detail .table-responsive { width: 100%; overflow-x: auto; }
.article-detail .md-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.article-detail .md-table th,
.article-detail .md-table td { border: 1px solid #e5e7eb; padding: 0.6rem 0.75rem; vertical-align: top; }
.article-detail .md-table thead th { background: #f3f4f6; color: #111827; font-weight: 600; }
.article-detail .md-table tbody tr:nth-child(even) { background: #f9fafb; }

/* Task list */
.article-detail .task-list-item { list-style: none; margin: 0.35rem 0; }
.article-detail .task-list-item input[type="checkbox"] { margin-right: 0.5rem; accent-color: #1e3a8a; }
.article-detail .task-list-item label { display: flex; align-items: flex-start; gap: 0.5rem; user-select: none; }

/* Footnotes */
.article-detail .footnotes { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid #e5e7eb; font-size: 0.9rem; color: #4b5563; }
.article-detail .footnotes ol { padding-left: 1.25rem; }
.article-detail .footnote-ref a { text-decoration: none; }
.article-detail .footnote-backref { margin-left: 0.5rem; color: #6b7280; text-decoration: none; }
.article-detail .footnote-backref:hover { text-decoration: underline; }

/* Images */
.article-detail .article-content img { max-width: 100%; height: auto; border-radius: 0.25rem; }

/* TOC (目录) */
.md-toc { border: 1px solid #e5e7eb; border-radius: 0.5rem; padding: 0.75rem 0.75rem 0.75rem 1rem; background: #f8fafc; margin: 0.75rem 0 1rem; }
.md-toc .toc-title { font-weight: 700; color: #1f2937; margin-bottom: 0.5rem; }
.md-toc .toc-list { list-style: none; padding: 0; margin: 0; }
.md-toc .toc-list li { margin: 0.25rem 0; }
.md-toc .toc-list a { color: #1e3a8a; text-decoration: none; }
.md-toc .toc-list a:hover { text-decoration: underline; }
.md-toc .toc-level-2 { padding-left: 0.75rem; }
.md-toc .toc-level-3 { padding-left: 1.25rem; }
.md-toc .toc-level-4 { padding-left: 1.75rem; }

/* Small helpers */
.article-detail .article-content mark { background: #fef08a; padding: 0 0.2em; }
.article-detail .article-content kbd { background: #111827; color: #f9fafb; border-radius: 0.25rem; padding: 0.1em 0.35em; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85em; }