/* Article HTML compatibility with standard-template-better-ad.
   Scoped to article content; Stablo page typography and layout stay in style.css. */

/* =============== Summary（淡蓝 + 左侧蓝边） =============== */
#post-content .summary-block {
  background-color: #f0f9ff;
  padding: 20px;
  border-left: 4px solid #2196F3;
  border-radius: 12px;
  margin: 25px 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
#post-content .summary-block h2 {
  font-weight: bold;
  color: #1976d2;
  margin: 0 0 10px;
}

/* =============== Experience（淡红 + 左侧红边） =============== */
#post-content .experience-box {
  background-color: #fff7f7;
  border-left: 4px solid #f44336;
  padding: 20px;
  border-radius: 10px;
  margin: 25px 0;
}
#post-content .experience-box h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 10px;
  color: #b71c1c;
}

/* =============== Expert Quote（浅绿 + 左侧绿边） =============== */
#post-content .expert-quote {
  background-color: #f0fff4;
  padding: 20px;
  border-left: 4px solid #2e7d32;
  margin: 25px 0;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
#post-content .expert-quote h2 {
  font-weight: bold;
  color: #2e7d32;
  margin: 0 0 10px;
}
#post-content .expert-quote p {
  font-size: 16px;
  line-height: 1.8;
  color: #333;
  margin: 0 0 10px;
}

/* =============== CTA（虚线红框） =============== */
#post-content .cta-block {
  background-color: #fff5f5;
  border: 2px dashed #d32f2f;
  padding: 20px 24px;
  margin: 30px 0;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 500;
  color: #222;
  line-height: 1.8;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

/* =============== FAQ（红边 + 卡片） =============== */
#post-content .faq-block {
  background: #ffffff;
  border: 2px solid #b91c1c;
  border-radius: 16px;
  padding: 40px;
  margin: 40px 0;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.03);
}
#post-content .faq-block > h2 {
  font-size: 26px;
  color: #b91c1c;
  font-weight: 700;
  padding-left: 16px;
  margin: 0 0 28px;
  border-left: 5px solid #b91c1c;
}
#post-content .faq-item {
  background: #fcfcfc;
  border: 1px solid #f1f1f1;
  border-radius: 14px;
  padding: 24px 28px;
  margin: 0 0 24px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.025);
  position: relative;
}
#post-content .faq-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
}
#post-content .faq-item h3 {
  font-size: 20px;
  font-weight: 600;
  color: #b91c1c;
  margin: 0 0 12px;
  padding-left: 32px;
  position: relative;
}
#post-content .faq-item h3::before {
  content: "?";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 20px;
  color: #b91c1c;
  background: #fff0f0;
  width: 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  border-radius: 50%;
  font-weight: bold;
}
#post-content .faq-item p {
  font-size: 17px;
  line-height: 1.9;
  color: #333;
  margin: 0;
}

/* =============== Author Box（淡粉 + 红边 + 圆头像） =============== */
#post-content .author-box {
  background-color: #fff0f0;
  border: 2px solid #b91c1c;
  border-radius: 16px;
  padding: 24px;
  margin-top: 40px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  font-size: 15px;
  line-height: 1.8;
  overflow: hidden;
  clear: both;
}
#post-content .author-meta {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
#post-content .author-avatar {
  width: 80px !important;
  height: 80px !important;
  object-fit: cover;
  border-radius: 50%;
}
#post-content .author-info { flex: 1; }
#post-content .author-keyword { margin: 0; font-size: 14px; color: #777; }
#post-content .author-description { margin-top: 12px; font-size: 15px; color: #333; line-height: 1.8; }

/* =============== External References（虚线红框 + 列表卡片） =============== */
#post-content .external-references {
  margin: 40px 0;
  padding: 40px;
  border: 2px dashed #d32f2f;
  border-radius: 16px;
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
#post-content .external-references > h2 {
  font-size: 24px;
  color: #222;
  font-weight: 700;
  border-left: 5px solid #b91c1c;
  padding-left: 12px;
  margin: 0 0 28px;
}
#post-content .reference-list { list-style: none; padding: 0; margin: 0; }
#post-content .reference-list li {
  background: #fcfcfc;
  border: 1px solid #eee;
  border-radius: 14px;
  padding: 20px 24px 20px 40px;
  margin: 0 0 20px;
  position: relative;
  transition: all 0.3s ease;
}
#post-content .reference-list li:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}
#post-content .reference-list li::before {
  content: "»";
  position: absolute;
  left: 12px;
  top: 20px;
  color: #d32f2f;
  font-size: 18px;
  font-weight: bold;
}
#post-content .reference-list a {
  font-weight: 600;
  font-size: 16px;
  color: #b91c1c;
  text-decoration: none;
}
#post-content .reference-list a:hover { text-decoration: underline; }
#post-content .reference-list small {
  display: block;
  font-size: 14px;
  color: #555;
  margin-top: 8px;
  line-height: 1.7;
}

/* =============== TOC（红边 + 淡红背景） =============== */
#post-content .table-of-contents,
#post-content .ez-toc-container {
  margin: 40px 0;
  padding: 30px 40px;
  border-radius: 16px;
  background-color: #fff7f7;
  border: 2px solid #b91c1c;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}
#post-content .table-of-contents > h2,
#post-content .ez-toc-title {
  font-size: 22px !important;
  font-weight: 700;
  color: #111;
  margin: 0 0 24px;
  padding-left: 12px;
  border-left: 4px solid #b91c1c;
}
#post-content .table-of-contents ul,
#post-content .ez-toc-list { list-style: none; padding: 0; margin: 0; }
#post-content .table-of-contents li,
#post-content .ez-toc-list li {
  margin: 0 0 12px;
  position: relative;
  padding-left: 24px;
  font-size: 16px;
  color: #000;
}
#post-content .table-of-contents li::before,
#post-content .ez-toc-list li::before {
  content: "»";
  position: absolute;
  left: 0;
  top: 0;
  color: #b91c1c;
  font-size: 16px;
  font-weight: bold;
}
#post-content .table-of-contents li a,
#post-content .ez-toc-list li a {
  text-decoration: none;
  color: #111;
  font-weight: 500;
  transition: color .2s ease;
}
#post-content .table-of-contents li a:hover,
#post-content .ez-toc-list li a:hover { color: #b91c1c; text-decoration: underline; }

/* =============== 表格（红边 + 交替行） =============== */
#post-content .responsive-table-container {
  overflow-x: auto;
  margin: 40px 0;
  border: 2px solid #b91c1c;
  border-radius: 12px;
  background-color: #fff7f7;
  padding: 20px;
}
#post-content table.styled-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  min-width: 400px;
  background-color: #fff;
}
#post-content .styled-table th {
  background-color: #b91c1c;
  color: #fff;
  font-weight: 700;
  padding: 14px 18px;
  border: 1px solid #e0e0e0;
  text-align: left;
}
#post-content .styled-table td {
  padding: 14px 18px;
  border: 1px solid #eee;
  color: #333;
  background-color: #fff;
  text-align: left;
}
#post-content .styled-table tr:hover td { background-color: #fff0f0; }
#post-content .styled-table tbody tr:nth-child(even) { background-color: #fafafa; }

/* =============== 图片统一风格 =============== */
#post-content .image-wrapper { text-align: center; margin: 24px 0; }
#post-content .inserted-image {
  max-width: 100%;
  border-radius: 8px;
  height: auto;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Keep the original prose rhythm outside explicitly marked content blocks. */
#post-content .author-avatar { flex: 0 0 80px; margin: 0; }
#post-content .author-info { min-width: 0; }
#post-content .image-wrapper img { margin-left: auto; margin-right: auto; }
#post-content :is(.summary-block, .experience-box, .expert-quote, .cta-block,
  .faq-item, .author-info, .external-references) > :first-child { margin-top: 0; }
#post-content :is(.summary-block, .experience-box, .expert-quote, .cta-block,
  .faq-item, .author-info, .external-references) > :last-child { margin-bottom: 0; }
#post-content :is(.table-of-contents, .ez-toc-list) :is(ul, ol) { list-style: none; }
#post-content :is(.table-of-contents, .ez-toc-list) li::marker { content: ''; }
#post-content :is(.table-of-contents, .ez-toc-list) li > :is(ul, ol) {
  margin: 12px 0 0; padding-left: 16px;
}
#post-content :is(h1, h2, h3, h4, h5, h6)[id] { scroll-margin-top: 24px; }

/* Rich-text editor tables, including colgroup, rowspan and colspan. */
#post-content table {
  width: 100%; max-width: 100%; border-collapse: collapse;
  border-spacing: 0; margin: 24px 0; color: var(--tw-prose-body);
}
#post-content :is(th, td) {
  min-width: 80px; padding: 14px 12px; border: 1px solid #d9dee8;
  vertical-align: top; text-align: left; line-height: 1.55; overflow-wrap: anywhere;
}
#post-content th { background: #f2f6ff; font-weight: 700; color: var(--tw-prose-headings); }
#post-content :is(th, td) p { margin: 0 0 8px; }
#post-content :is(th, td) p:last-child { margin-bottom: 0; }
#post-content :is(.article-table-scroll, .tableWrapper) {
  max-width: 100%; overflow-x: auto; margin: 24px 0;
}
#post-content :is(.article-table-scroll, .tableWrapper, .responsive-table-container):focus-visible {
  outline: 2px solid #2563eb; outline-offset: 3px;
}
#post-content :is(.article-table-scroll, .tableWrapper, .responsive-table-container) > table {
  display: table; margin: 0;
}
#post-content table.styled-table { background: #fff; }
#post-content .styled-table th { background: #b91c1c; color: #fff; padding: 14px 18px; }
#post-content .styled-table td { padding: 14px 18px; color: #333; background: #fff; }
#post-content .styled-table tbody tr:nth-child(even) td { background: #fafafa; }
#post-content .styled-table tbody tr:hover td { background: #fff0f0; }

/* Preserve the editor's inline background/border/padding values. These panels
   have their own light surface even when the surrounding article is dark. */
#post-content [data-rich-content-section] {
  display: block; box-sizing: border-box; min-height: 72px; margin: 24px 0;
  overflow: hidden; padding: 24px 32px; border: 2px solid #c5222a;
  border-radius: 16px; background: #fff7f7; color: #1f2937;
  --tw-prose-body: #1f2937; --tw-prose-headings: #111827;
  --tw-prose-bold: #111827; --tw-prose-links: #2563eb;
  --tw-prose-quotes: #374151; --tw-prose-code: #111827;
  --tw-prose-counters: #4b5563; --tw-prose-bullets: #6b7280;
  --tw-prose-captions: #4b5563; --tw-prose-th-borders: #d1d5db;
  --tw-prose-td-borders: #e5e7eb;
}
#post-content [data-rich-content-section] > :first-child { margin-top: 0; }
#post-content [data-rich-content-section] > :last-child { margin-bottom: 0; }
#post-content [data-rich-content-section] :is(h1, h2, h3) { margin-bottom: 14px; }
#post-content [data-rich-content-section] :is(ul, ol) { margin-bottom: 12px; }

/* Legacy article figures and quotes work without Bootstrap or icon fonts. */
#post-content::after { content: ''; display: block; clear: both; }
#post-content :is(figure, .post-attachement).pull-left { float: left; max-width: 50%; margin-right: 15px; }
#post-content :is(figure, .post-attachement).pull-right { float: right; max-width: 50%; margin-left: 15px; }
#post-content figure > img { width: 100%; }
#post-content figure > figcaption { text-align: center; font-style: italic; }
#post-content blockquote.blockquote { padding: 24px; border: 2px solid var(--tw-prose-quote-borders); }
#post-content .blockquote-footer { color: var(--tw-prose-captions); font-size: .875em; }

/* Explicit block colors also work with Stablo's system/persisted dark theme. */
.dark #post-content .summary-block { background: #102537; border-color: #60a5fa; }
.dark #post-content .summary-block h2 { color: #93c5fd; }
.dark #post-content :is(.experience-box, .cta-block, .author-box, .table-of-contents, .ez-toc-container, .responsive-table-container) {
  background: #2b181c; border-color: #f87171;
}
.dark #post-content .expert-quote { background: #11291e; border-color: #4ade80; }
.dark #post-content .expert-quote h2 { color: #86efac; }
.dark #post-content :is(.faq-block, .external-references) { background: #171717; border-color: #f87171; }
.dark #post-content :is(.faq-item, .reference-list li) { background: #202020; border-color: #404040; }
.dark #post-content :is(.experience-box h2, .faq-block > h2, .faq-item h3, .reference-list a) { color: #fca5a5; }
.dark #post-content :is(.faq-block > h2, .external-references > h2, .table-of-contents > h2, .ez-toc-title) { border-color: #f87171; }
.dark #post-content :is(.expert-quote p, .cta-block, .faq-item p, .author-description,
  .external-references > h2, .table-of-contents > h2, .ez-toc-title,
  .table-of-contents li, .ez-toc-list li, .table-of-contents li a, .ez-toc-list li a) { color: #e5e5e5; }
.dark #post-content :is(.author-keyword, .reference-list small) { color: #a3a3a3; }
.dark #post-content .faq-item h3::before { color: #fca5a5; background: #451a1a; }
.dark #post-content :is(.reference-list li, .table-of-contents li, .ez-toc-list li)::before { color: #fca5a5; }
.dark #post-content :is(.table-of-contents li a, .ez-toc-list li a):hover { color: #fca5a5; }
.dark #post-content :is(th, td) { border-color: #525252; }
.dark #post-content th { background: #262626; }
.dark #post-content .styled-table th { background: #7f1d1d; color: #fff; }
.dark #post-content .styled-table td { background: #202020; color: #e5e5e5; }
.dark #post-content .styled-table tbody tr:nth-child(even) td { background: #292929; }
.dark #post-content .styled-table tbody tr:hover td { background: #3b2024; }
.dark #post-content [data-rich-content-section] table:not(.styled-table) th { background: #f2f6ff; }
.dark #post-content [data-rich-content-section] :is(th, td) { border-color: #d9dee8; }

@media (max-width: 767px) {
  #post-content :is(.summary-block, .experience-box, .expert-quote, .cta-block,
    .faq-block, .author-box, .external-references, .table-of-contents, .ez-toc-container) { padding: 20px 18px; }
  #post-content .faq-item { padding: 18px 14px; }
  #post-content .responsive-table-container { padding: 12px; }
  #post-content :is(th, td) { min-width: 120px; }
  #post-content [data-rich-content-section] { padding-left: 18px !important; padding-right: 18px !important; }
  #post-content :is(figure, .post-attachement):is(.pull-left, .pull-right) { float: none; max-width: 100%; margin-left: 0; margin-right: 0; }
}
@media (max-width: 480px) {
  #post-content .author-meta { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  #post-content :is(.faq-item, .reference-list li) { transition: none; }
  #post-content :is(.faq-item, .reference-list li):hover { transform: none; }
}
