body.article-reading-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 3%, rgba(23, 105, 224, .045), transparent 31rem),
    radial-gradient(circle at 90% 20%, rgba(0, 167, 200, .035), transparent 27rem),
    #fff;
}

.article-reading-body .site-bg { opacity: .34; mask-image: linear-gradient(to bottom, #000 0, transparent 72%); }
.article-detail-page { min-height: 80vh; padding-top: 16px; }
.article-detail-loading { display: grid; width: min(760px, calc(100% - 32px)); min-height: 60vh; margin: 20px auto; align-content: center; gap: 12px; }
.article-detail-loading span { height: 20px; border-radius: 999px; background: rgba(23, 32, 51, .07); }
.article-detail-loading span:first-child { width: 38%; }
.article-detail-loading span:nth-child(2) { width: 100%; height: 52px; }
.article-detail-loading span:nth-child(3) { width: 72%; }
.article-detail-loading p { color: var(--text-muted); }

.article-hero { max-width: 1120px; padding-top: 14px; }
.article-back-button {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 30px;
  place-items: center;
  border: 1px solid rgba(221, 227, 235, .82);
  border-radius: 50%;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 10px 28px rgba(22, 42, 70, .065);
  color: var(--text-main);
  text-decoration: none;
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  transition: transform .22s ease, background .22s ease, box-shadow .22s ease;
}
.article-back-button:hover { transform: translateX(-3px); background: #fff; box-shadow: 0 14px 34px rgba(22, 42, 70, .1); }
.article-back-button [data-icon] { width: 19px; height: 19px; transform: rotate(180deg); }
.article-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.article-hero-tags span { padding: 6px 11px; border: 1px solid rgba(23, 105, 224, .08); border-radius: 999px; background: rgba(23, 105, 224, .07); color: #1769e0; font-size: 12px; font-weight: 720; }
.article-hero h1 { max-width: 940px; margin: 0; font-size: clamp(42px, 7vw, 78px); line-height: 1.04; letter-spacing: -.055em; }
.article-byline { display: flex; align-items: center; gap: 12px; margin-top: 28px; }
.article-author-avatar { display: grid; width: 48px; height: 48px; overflow: hidden; place-items: center; border: 1px solid rgba(221, 227, 235, .88); border-radius: 50%; background: rgba(255, 255, 255, .82); font-weight: 800; backdrop-filter: blur(16px); }
.article-author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.article-byline strong { font-size: 14px; }
.article-byline p { margin: 4px 0 0; color: var(--text-muted); font-size: 12px; }
.article-layout { display: grid; max-width: 800px; grid-template-columns: minmax(0, 800px); justify-content: center; gap: 0; padding-top: 44px; }
.article-layout.has-toc { max-width: 1120px; grid-template-columns: minmax(0, 760px) 250px; justify-content: space-between; gap: 64px; }
.article-main-column,
.article-aside { min-width: 0; }
.article-aside > section { position: sticky; top: 88px; max-height: calc(100vh - 112px); overflow: auto; padding: 20px 20px 20px 24px; border: 1px solid rgba(221, 227, 235, .8); border-radius: 22px; background: rgba(255, 255, 255, .68); box-shadow: 0 14px 38px rgba(22, 42, 70, .045); scrollbar-width: thin; backdrop-filter: blur(20px); }
.article-toc-toggle { display: none; }
.article-aside-label { display: block; margin-bottom: 14px; color: var(--text-muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.article-toc { display: grid; gap: 5px; }
.article-toc a { position: relative; padding: 8px 10px; border-radius: 12px; color: var(--text-muted); font-size: 13px; line-height: 1.4; text-decoration: none; transition: color .2s ease, background .2s ease, transform .2s ease; }
.article-toc a[data-level="3"] { padding-left: 22px; }
.article-toc a:hover { background: rgba(23, 105, 224, .07); color: var(--text-main); }
.article-toc a.is-active { background: rgba(23, 105, 224, .09); color: #1769e0; font-weight: 720; transform: translateX(2px); }
.article-toc-color { color: inherit; }
.article-toc-progress { position: absolute; top: 53px; bottom: 20px; left: 11px; width: 2px; overflow: hidden; border-radius: 999px; background: rgba(23, 105, 224, .09); pointer-events: none; }
.article-toc-progress i { display: block; width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(#1769e0, #00a7c8); transform: scaleY(0); transform-origin: top; transition: transform .28s ease; }

.article-attachments,
.article-postscript,
.article-comments,
.article-author-card,
.article-related { margin-top: 70px; padding-top: 34px; border-top: 1px solid var(--border, #e7eaf0); }
.article-block-heading h2,
.article-postscript-heading h2 { margin: 3px 0 22px; font-size: 30px; }
.article-attachment-list { display: grid; gap: 10px; }
.article-attachment { display: flex; align-items: center; gap: 13px; padding: 14px; border: 1px solid rgba(221, 227, 235, .82); border-radius: 18px; background: rgba(255, 255, 255, .7); box-shadow: 0 10px 28px rgba(22, 42, 70, .04); backdrop-filter: blur(16px); }
.article-attachment > span:first-child { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 14px; background: rgba(23, 105, 224, .08); color: var(--primary); }
.article-attachment-copy { min-width: 0; flex: 1; }
.article-attachment-copy strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.article-attachment-copy small { color: var(--text-muted); }
.article-attachment a { display: inline-flex; min-height: 32px; align-items: center; padding: 0 11px; border-radius: 999px; background: rgba(23, 105, 224, .075); color: var(--primary); font-size: 13px; font-weight: 750; text-decoration: none; }

.article-postscript {
  padding: 30px;
  border: 1px solid rgba(221, 227, 235, .82);
  border-radius: 28px;
  background: rgba(255, 255, 255, .64);
  box-shadow: 0 18px 52px rgba(22, 42, 70, .055);
  -webkit-backdrop-filter: blur(24px) saturate(135%);
  backdrop-filter: blur(24px) saturate(135%);
}
.article-postscript-heading h2 { margin-bottom: 24px; }
.article-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; }
.article-facts div { min-width: 0; padding: 14px 15px; border-radius: 17px; background: rgba(239, 242, 246, .76); }
.article-facts dt { margin-bottom: 7px; color: var(--text-muted); font-size: 11px; font-weight: 720; letter-spacing: .04em; }
.article-facts dd { overflow: hidden; margin: 0; color: var(--text-main); font-size: 14px; font-weight: 760; text-overflow: ellipsis; white-space: nowrap; }
.article-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; padding-top: 22px; border-top: 1px solid rgba(221, 227, 235, .8); }
.article-actions button,
.article-actions a { display: inline-flex; min-height: 43px; align-items: center; gap: 7px; padding: 0 15px; border: 1px solid rgba(221, 227, 235, .86); border-radius: 999px; background: rgba(255, 255, 255, .72); box-shadow: 0 7px 20px rgba(22, 42, 70, .045); color: var(--text-main); cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; text-decoration: none; backdrop-filter: blur(18px); }
.article-actions button:hover,
.article-actions a:hover { border-color: rgba(23, 105, 224, .26); background: rgba(255, 255, 255, .96); }
.article-actions [data-icon] { width: 17px; height: 17px; }
.article-actions strong { color: var(--text-muted); font-size: 12px; }
.article-actions button.is-liked { border-color: rgba(23, 105, 224, .25); color: #1769e0; background: rgba(23, 105, 224, .08); }

.article-author-card { display: flex; align-items: center; gap: 16px; }
.article-author-card img,
.article-author-card > span { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; }
.article-author-card > span { display: grid; flex: 0 0 58px; place-items: center; background: rgba(23, 105, 224, .08); color: #1769e0; font-weight: 800; }
.article-author-card div { flex: 1; }
.article-author-card h2 { margin: 0; font-size: 19px; }
.article-author-card p { margin: 5px 0 0; color: var(--text-muted); font-size: 14px; line-height: 1.6; }

.article-adjacent,
.article-related-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.article-related-list { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 10px; }
.article-adjacent:empty,
.article-related-list:empty { display: none; }
.article-related a { display: flex; min-width: 0; min-height: 118px; box-sizing: border-box; flex-direction: column; padding: 17px; border: 1px solid rgba(221, 227, 235, .82); border-radius: 20px; background: rgba(255,255,255,.62); color: var(--text-main); text-decoration: none; transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.article-related a:hover { border-color: rgba(23,105,224,.22); background: rgba(255,255,255,.9); transform: translateY(-2px); }
.article-related a small { color: #1769e0; font-size: 10px; font-weight: 800; }
.article-related a strong { display: -webkit-box; overflow: hidden; margin-top: 8px; font-size: 15px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.article-related a span { overflow: hidden; margin-top: auto; padding-top: 12px; color: var(--text-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.article-comment-form { margin-bottom: 26px; }
.article-comment-form textarea { width: 100%; box-sizing: border-box; padding: 16px 17px; border: 1px solid rgba(221, 227, 235, .86); border-radius: 20px; outline: 0; background: rgba(255, 255, 255, .68); color: var(--text-main); font: inherit; resize: vertical; backdrop-filter: blur(16px); }
.article-comment-form textarea:focus { border-color: rgba(23, 105, 224, .5); background: rgba(255, 255, 255, .94); box-shadow: 0 0 0 4px rgba(23, 105, 224, .09); }
.article-comment-form > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.article-comment-form .btn { border-radius: 999px; }
.article-comment-form [data-comment-status] { color: var(--text-muted); font-size: 12px; }
.article-comment-list { display: grid; gap: 12px; }
.article-comment { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 11px; padding: 16px 0; border-bottom: 1px solid var(--border, #e7eaf0); }
.article-comment-avatar { width: 38px; height: 38px; overflow: hidden; border-radius: 50%; background: #edf1f5; }
.article-comment-avatar > span { display: grid; width: 100%; height: 100%; place-items: center; color: #1769e0; font-size: 13px; font-weight: 800; }
.article-comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.article-comment-head { display: flex; min-height: 24px; flex-wrap: wrap; align-items: center; gap: 7px; }
.article-comment-head strong { font-size: 13px; }
.article-comment-head time { color: var(--text-muted); font-size: 11px; }
.article-comment-badge { display: inline-flex; min-height: 20px; align-items: center; padding: 0 7px; border-radius: 999px; background: rgba(23, 105, 224, .08); color: #1769e0; font-size: 9px; font-weight: 800; }
.article-comment-badge.is-official { background: rgba(0, 167, 200, .1); color: #007f99; }
.article-comment-delete { min-height: 28px; margin-left: auto; padding: 0 9px; border: 0; border-radius: 999px; background: transparent; color: var(--text-muted); cursor: pointer; font: inherit; font-size: 11px; }
.article-comment-delete:hover { background: rgba(206, 45, 45, .08); color: #b42318; }
.article-comment-delete:disabled { cursor: wait; opacity: .5; }
.article-comment p { margin: 7px 0 0; font-size: 14px; line-height: 1.65; white-space: pre-wrap; }
.article-empty-comments { color: var(--text-muted); font-size: 14px; }
.article-error { max-width: 760px; padding-top: 90px; padding-bottom: 130px; text-align: center; }
.article-error strong { font-size: 28px; }
.article-error p { color: var(--text-muted); }
.article-detail-page [hidden] { display: none !important; }

.article-toast {
  position: fixed;
  z-index: 1400;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 18px));
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 16px;
  border: 1px solid rgba(221, 227, 235, .86);
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 18px 52px rgba(22, 42, 70, .16);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 680;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(.97);
  transition: opacity .2s ease, transform .2s ease;
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
}
.article-toast.is-visible { opacity: 1; transform: none; }
.article-toast.is-success { border-color: rgba(23, 105, 224, .18); }
.article-toast.is-error { border-color: rgba(180, 35, 24, .2); color: #9f2117; }

:root[data-theme="dark"] body.article-reading-body { background: radial-gradient(circle at 12% 3%, rgba(57, 131, 238, .12), transparent 31rem), radial-gradient(circle at 90% 20%, rgba(0, 167, 200, .07), transparent 27rem), #090d12; }
:root[data-theme="dark"] .article-reading-body .site-bg { opacity: .14; }
:root[data-theme="dark"] .article-back-button,
:root[data-theme="dark"] .article-author-avatar,
:root[data-theme="dark"] .article-actions button,
:root[data-theme="dark"] .article-actions a,
:root[data-theme="dark"] .article-attachment,
:root[data-theme="dark"] .article-comment-form textarea,
:root[data-theme="dark"] .article-aside > section,
:root[data-theme="dark"] .article-postscript { border-color: rgba(255, 255, 255, .095); background: rgba(18, 27, 38, .72); box-shadow: 0 18px 48px rgba(0, 0, 0, .23); }
:root[data-theme="dark"] .article-facts div { background: rgba(255, 255, 255, .06); }
:root[data-theme="dark"] .article-actions { border-top-color: rgba(255, 255, 255, .09); }
:root[data-theme="dark"] .article-back-button:hover,
:root[data-theme="dark"] .article-actions button:hover,
:root[data-theme="dark"] .article-actions a:hover,
:root[data-theme="dark"] .article-comment-form textarea:focus { background: rgba(27, 39, 52, .94); }
:root[data-theme="dark"] .article-hero-tags span { border-color: rgba(94, 161, 255, .1); background: rgba(94, 161, 255, .12); color: #83b8ff; }
:root[data-theme="dark"] .article-attachment a { background: rgba(94, 161, 255, .12); color: #83b8ff; }
:root[data-theme="dark"] .article-detail-loading span { background: rgba(255, 255, 255, .07); }
:root[data-theme="dark"] .article-comment-badge { background: rgba(94, 161, 255, .13); color: #83b8ff; }
:root[data-theme="dark"] .article-comment-badge.is-official { background: rgba(46, 199, 219, .12); color: #69d7e5; }
:root[data-theme="dark"] .article-comment-delete:hover { background: rgba(255, 107, 98, .1); color: #ff928a; }
:root[data-theme="dark"] .article-toast { border-color: rgba(255,255,255,.1); background: rgba(18, 27, 38, .92); box-shadow: 0 18px 52px rgba(0,0,0,.35); }
:root[data-theme="dark"] .article-toast.is-error { color: #ff9a93; }
:root[data-theme="dark"] .article-related a { border-color: rgba(255,255,255,.09); background: rgba(18,27,38,.62); }
:root[data-theme="dark"] .article-related a:hover { border-color: rgba(94,161,255,.2); background: rgba(27,39,52,.86); }

@media (max-width: 960px) {
  .article-layout.has-toc { max-width: 800px; grid-template-columns: minmax(0, 800px); justify-content: center; gap: 0; }
  .article-layout.has-toc .article-main-column { grid-row: 2; }
  .article-layout.has-toc .article-aside { display: block; grid-row: 1; margin-bottom: 26px; }
  .article-aside > section { position: relative; top: auto; max-height: none; overflow: hidden; padding: 0; border-radius: 18px; }
  .article-toc-toggle { display: flex; width: 100%; min-height: 50px; align-items: center; justify-content: space-between; gap: 12px; padding: 0 17px; border: 0; background: transparent; color: var(--text-main); cursor: pointer; font: inherit; font-size: 13px; font-weight: 760; text-align: left; }
  .article-toc-toggle i { width: 9px; height: 9px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translate(-2px, 2px); transition: transform .2s ease; }
  .article-aside > section.is-open .article-toc-toggle i { transform: rotate(225deg) translate(-2px, 2px); }
  .article-aside-label,
  .article-toc-progress { display: none; }
  .article-toc { max-height: 0; overflow: hidden; gap: 3px; padding: 0 8px; border-top: 1px solid transparent; opacity: 0; transition: max-height .28s ease, padding .28s ease, opacity .2s ease, border-color .2s ease; }
  .article-aside > section.is-open .article-toc { max-height: min(52vh, 520px); overflow-y: auto; padding: 8px 8px 12px; border-top-color: rgba(221, 227, 235, .72); opacity: 1; }
  .article-toc a { display: flex; min-height: 42px; box-sizing: border-box; align-items: center; padding: 10px 12px; }
  .article-toc a[data-level="3"] { padding-left: 28px; }
  :root[data-theme="dark"] .article-aside > section.is-open .article-toc { border-top-color: rgba(255,255,255,.08); }
}

@media (max-width: 720px) {
  .article-detail-page { padding-top: 8px; }
  .article-hero { padding-top: 10px; }
  .article-back-button { width: 42px; height: 42px; margin-bottom: 24px; }
  .article-hero h1 { font-size: clamp(38px, 12vw, 58px); }
  .article-layout,
  .article-layout.has-toc { gap: 0; padding-top: 42px; }
  .article-attachments,
  .article-postscript,
  .article-comments,
  .article-author-card,
  .article-related { margin-top: 52px; }
  .article-postscript { padding: 22px; border-radius: 24px; }
  .article-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-actions { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 3px; }
  .article-actions button,
  .article-actions a { min-height: 44px; flex: 0 0 auto; }
  .article-related-list { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .article-facts { gap: 8px; }
  .article-facts div { padding: 13px; }
  .article-postscript { padding: 19px; }
  .article-attachment { align-items: flex-start; flex-wrap: wrap; }
  .article-attachment a { margin-left: 55px; }
  .article-comment-head time { width: 100%; order: 3; }
  .article-comment-delete { order: 2; }
  .article-toast { right: 16px; bottom: max(18px, calc(env(safe-area-inset-bottom) + 12px)); max-width: calc(100vw - 32px); box-sizing: border-box; border-radius: 18px; }
  .article-adjacent { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .article-toast,
  .article-toc,
  .article-toc-toggle i { transition: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .article-back-button,
  .article-actions button,
  .article-actions a,
  .article-attachment,
  .article-comment-form textarea,
  .article-aside > section,
  .article-postscript,
  .article-related a { background: #fff; backdrop-filter: none; }
  :root[data-theme="dark"] .article-back-button,
  :root[data-theme="dark"] .article-actions button,
  :root[data-theme="dark"] .article-actions a,
  :root[data-theme="dark"] .article-attachment,
  :root[data-theme="dark"] .article-comment-form textarea,
  :root[data-theme="dark"] .article-aside > section,
  :root[data-theme="dark"] .article-postscript,
  :root[data-theme="dark"] .article-related a { background: #121b26; }
}
