/* Articles: home (articles.php) and reader (article.php). Editorial layout; the reading area follows
   html[data-reader=dark|light] (reader-theme.js) and html[data-reader-font=0..4]. */
.reader {
  --r-bg: #0F1419; --r-surface: #1A2027; --r-surface-2: #222B34; --r-text: #E8EAED; --r-head: #FFFFFF; --r-muted: #9CA3AF;
  --r-line: rgba(255,255,255,.09); --r-accent: #F49156; --r-quote: #C7CDD4; --r-mark: rgba(244,145,86,.16);
  --r-size: 1.18rem;
  background: var(--r-bg); color: var(--r-text); padding-bottom: 3rem;
}
html[data-reader="light"] .reader {
  --r-bg: #FBFAF7; --r-surface: #FFFFFF; --r-surface-2: #F3F1EC; --r-text: #23272E; --r-head: #111418; --r-muted: #5E6672;
  --r-line: rgba(17,20,24,.1); --r-accent: #C9572B; --r-quote: #3B414A; --r-mark: rgba(201,87,43,.12);
}
html[data-reader="light"] body.area-public .public-main { background: #FBFAF7; }
html[data-reader-font="0"] .reader { --r-size: 1.02rem; }
html[data-reader-font="2"] .reader { --r-size: 1.3rem; }
html[data-reader-font="3"] .reader { --r-size: 1.44rem; }
html[data-reader-font="4"] .reader { --r-size: 1.6rem; }
.reader a { color: var(--r-accent); }
.reader h1, .reader h2, .reader h3, .reader h4 { color: var(--r-head); }

/* shared bits */
.art-crumbs { display: flex; gap: .4rem; flex-wrap: wrap; font-size: .88rem; color: var(--r-muted); margin-bottom: .9rem; }
.art-crumbs a { color: var(--r-muted); text-decoration: none; } .art-crumbs a:hover { color: var(--r-accent); }
.art-meta-top { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; }
.art-chip { --c: #F49156; display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .01em; color: var(--c) !important; text-decoration: none;
  padding: .18rem .6rem; border-radius: 999px; background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.art-lock { font-size: .78rem; color: #F2C14E; font-weight: 700; }
html[data-reader="light"] .art-lock { color: #9A6B00; }
.art-tool { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-width: 38px; height: 38px; padding: 0 .6rem; border-radius: 10px;
  border: 1px solid var(--r-line); background: var(--r-surface); color: var(--r-text) !important; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; transition: border-color .15s, color .15s; }
.art-tool:hover { border-color: var(--r-accent); color: var(--r-accent) !important; }
.art-tool small { font-size: .7em; }
.art-tool.on { background: var(--r-accent); border-color: var(--r-accent); color: #fff !important; }
.art-tool[hidden] { display: none; }

/* subscribe */
.art-sub-btn { display: inline-flex; align-items: center; gap: .4rem; height: 38px; padding: 0 1rem; border-radius: 10px; border: 0; font: inherit; font-weight: 700; cursor: pointer;
  background: linear-gradient(135deg, #F49156, #EC675A); color: #fff !important; text-decoration: none; }
.art-sub-btn.on { background: var(--r-surface); color: var(--r-text) !important; border: 1px solid var(--r-line); }
.art-sub-box { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1.1rem 1.25rem; margin: 2rem 0 0; border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--r-accent) 12%, var(--r-surface)), var(--r-surface)); border: 1px solid color-mix(in srgb, var(--r-accent) 30%, transparent); }
.art-sub-box > i { font-size: 1.8rem; color: var(--r-accent); }
.art-sub-box > div { flex: 1 1 260px; display: flex; flex-direction: column; gap: .2rem; }
.art-sub-box b { color: var(--r-head); font-size: 1.05rem; } .art-sub-box span { color: var(--r-muted); font-size: .92rem; }
.art-sub-box.on > i { color: #3DBE8B; }

/* ---------------------------------------------------------------- home */
.art-home-head { padding: 2.2rem 0 1.2rem; border-bottom: 1px solid var(--r-line);
  background: radial-gradient(900px 300px at 85% -20%, color-mix(in srgb, var(--r-accent) 16%, transparent), transparent); }
.art-home-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.art-home-top h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 800; margin: 0; letter-spacing: -.01em; }
.art-home-tag { color: var(--r-muted); margin: .4rem 0 0; font-size: 1.05rem; max-width: 60ch; }
.art-home-tools { display: flex; gap: .5rem; align-items: center; }
.art-search { display: flex; align-items: center; gap: .5rem; margin-top: 1.25rem; max-width: 640px; padding: .35rem .4rem .35rem .9rem; border-radius: 14px;
  background: var(--r-surface); border: 1px solid var(--r-line); }
.art-search:focus-within { border-color: var(--r-accent); }
.art-search i { color: var(--r-muted); }
.art-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--r-text); font: inherit; padding: .35rem 0; }
.art-cats { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.art-cats a { --c: var(--r-accent); padding: .35rem .85rem; border-radius: 999px; border: 1px solid var(--r-line); color: var(--r-text); text-decoration: none; font-size: .92rem; background: var(--r-surface); }
.art-cats a small { color: var(--r-muted); }
.art-cats a:hover { border-color: var(--c); }
.art-cats a.on { background: var(--c); border-color: var(--c); color: #fff; } .art-cats a.on small { color: rgba(255,255,255,.8); }
.art-home-body { padding-top: 1.75rem; }
.art-results { color: var(--r-muted); }
.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.art-card { display: flex; flex-direction: column; background: var(--r-surface); border: 1px solid var(--r-line); border-radius: 16px; overflow: hidden; transition: transform .2s, border-color .2s; }
.art-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--r-accent) 45%, transparent); }
.art-card-img { display: block; aspect-ratio: 16 / 9; background: var(--r-surface-2); overflow: hidden; }
.art-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.art-card:hover .art-card-img img { transform: scale(1.04); }
.art-card-body { padding: 1rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.art-card-title { font-size: 1.15rem; line-height: 1.55; margin: 0; font-weight: 800; }
.art-card-title a { color: var(--r-head) !important; text-decoration: none; }
.art-card-title a:hover { color: var(--r-accent) !important; }
.art-card-intro { color: var(--r-muted); margin: 0; line-height: 1.8; font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.art-byline { display: flex; gap: .4rem; flex-wrap: wrap; color: var(--r-muted); font-size: .82rem; margin-top: auto; padding-top: .35rem; }
.art-hero-wrap { margin-bottom: 2rem; }
.art-card.art-lead { display: grid; grid-template-columns: 1.35fr 1fr; }
.art-card.art-lead .art-card-img { aspect-ratio: auto; min-height: 340px; }
.art-card.art-lead .art-card-body { padding: 2rem; justify-content: center; gap: .7rem; }
.art-card.art-lead .art-card-title { font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.45; }
.art-card.art-lead .art-card-intro { font-size: 1.05rem; -webkit-line-clamp: 5; }
.art-card.art-lead .art-byline { margin-top: .5rem; }
.art-empty { text-align: center; color: var(--r-muted); padding: 4rem 1rem; } .art-empty i { font-size: 2.6rem; margin-bottom: .75rem; opacity: .6; }
.art-pager { margin-top: 2rem; display: flex; justify-content: center; }
.reader .pagination .page-link { background: var(--r-surface); border-color: var(--r-line); color: var(--r-text); }
.reader .pagination .active .page-link { background: var(--r-accent); border-color: var(--r-accent); color: #fff; }
@media (max-width: 767.98px) {
  .art-card.art-lead { grid-template-columns: 1fr; }
  .art-card.art-lead .art-card-img { min-height: 0; aspect-ratio: 16 / 9; }
  .art-card.art-lead .art-card-body { padding: 1.1rem; }
  .art-grid { grid-template-columns: 1fr; gap: 1.1rem; }
}

/* ---------------------------------------------------------------- article */
.art-progress { position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 1040; pointer-events: none; }
.art-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #F49156, #EC675A); }
.art-head { max-width: 860px; padding-top: 2.2rem; }
.art-title { font-size: clamp(1.8rem, 4.4vw, 3rem); line-height: 1.35; font-weight: 800; margin: .25rem 0 .6rem; letter-spacing: -.01em; }
.art-subtitle { font-size: clamp(1.08rem, 2vw, 1.35rem); color: var(--r-muted); line-height: 1.7; margin: 0 0 1.2rem; }
.art-head-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 0; border-top: 1px solid var(--r-line); border-bottom: 1px solid var(--r-line); }
.art-author { display: flex; align-items: center; gap: .75rem; }
.art-author img, .art-author-ph { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.art-author-ph { display: inline-flex; align-items: center; justify-content: center; background: var(--r-surface-2); color: var(--r-accent); }
.art-author > div { display: flex; flex-direction: column; line-height: 1.5; }
.art-author b, .art-author b a { color: var(--r-head); text-decoration: none; } .art-author b a:hover { color: var(--r-accent); }
.art-author span { color: var(--r-muted); font-size: .86rem; }
.art-tools { display: flex; gap: .4rem; flex-wrap: wrap; }
.art-listen.on { background: var(--r-accent); border-color: var(--r-accent); color: #fff !important; }
.art-player { display: flex; align-items: center; gap: .5rem; margin-top: .8rem; padding: .5rem; border-radius: 12px; background: var(--r-surface); border: 1px solid var(--r-line); }
.art-player[hidden] { display: none; }
.art-player-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--r-surface-2); overflow: hidden; }
.art-player-bar i { display: block; height: 100%; width: 0; background: var(--r-accent); transition: width .3s; }
.art-player select { height: 38px; border-radius: 10px; border: 1px solid var(--r-line); background: var(--r-surface); color: var(--r-text); padding: 0 .4rem; font: inherit; }
.art-cover { max-width: 1100px; margin: 1.6rem auto 0; }
.art-cover img { width: 100%; max-height: 620px; object-fit: cover; border-radius: 18px; display: block; }
.art-cover figcaption { color: var(--r-muted); font-size: .85rem; margin-top: .5rem; text-align: center; }
.art-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; max-width: 860px; padding-top: 2rem; }
.art-layout:has(.art-toc) { max-width: 1160px; grid-template-columns: 250px minmax(0, 720px); justify-content: center; }
.art-toc details { position: sticky; top: 90px; padding: 1rem; border-radius: 14px; background: var(--r-surface); border: 1px solid var(--r-line); max-height: calc(100vh - 120px); overflow: auto; }
.art-toc summary { font-weight: 800; color: var(--r-head); cursor: pointer; }
.art-toc ol { list-style: none; padding: 0; margin: .75rem 0 0; display: flex; flex-direction: column; gap: .35rem; }
.art-toc li a { color: var(--r-muted); text-decoration: none; font-size: .9rem; line-height: 1.6; display: block; }
.art-toc li a:hover { color: var(--r-accent); }
.art-toc li.h3 { padding-inline-start: .9rem; }
.art-main { min-width: 0; }
.art-lede { font-size: calc(var(--r-size) * 1.08); line-height: 2; color: var(--r-head); font-weight: 500; margin-bottom: 1.6rem; padding-inline-start: 1rem; border-inline-start: 3px solid var(--r-accent); }
.reader .art-body { font-size: var(--r-size); line-height: 2.05; color: var(--r-text); }
.reader .art-body p { margin: 0 0 1.35em; }
.reader .art-body h2 { font-size: 1.55em; line-height: 1.5; margin: 1.8em 0 .7em; font-weight: 800; scroll-margin-top: 90px; }
.reader .art-body h3 { font-size: 1.25em; line-height: 1.55; margin: 1.5em 0 .6em; font-weight: 800; scroll-margin-top: 90px; }
.reader .art-body h4 { font-size: 1.08em; margin: 1.3em 0 .5em; }
.reader .art-body ul, .art-body ol { padding-inline-start: 1.5em; margin-bottom: 1.35em; } .art-body li { margin-bottom: .45em; }
.reader .art-body blockquote { margin: 1.8em 0; padding: .4em 1.2em; border-inline-start: 4px solid var(--r-accent); font-size: 1.12em; line-height: 1.9; color: var(--r-quote); font-weight: 500; }
.reader .art-body figure { margin: 2em 0; } .art-body img { max-width: 100%; height: auto; border-radius: 12px; display: block; margin: 0 auto; }
.reader .art-body figcaption { color: var(--r-muted); font-size: .8em; text-align: center; margin-top: .5em; }
.reader .art-body a { text-decoration: underline; text-underline-offset: 3px; }
.reader .art-body hr { border: 0; text-align: center; margin: 2.2em 0; opacity: 1; } .art-body hr::after { content: '• • •'; color: var(--r-muted); letter-spacing: .5em; }
.reader .art-body table { font-size: .88em; }
.reader .art-body td, .art-body th { border-color: var(--r-line) !important; }
.reader .art-body .art-reading { background: var(--r-mark); border-radius: 6px; box-shadow: 0 0 0 6px var(--r-mark); }
.art-title.art-reading, .art-lede.art-reading { background: var(--r-mark); border-radius: 6px; }
.art-teaser { position: relative; max-height: 22em; overflow: hidden; }
.art-teaser::after { content: ''; position: absolute; inset: auto 0 0 0; height: 9em; background: linear-gradient(to bottom, transparent, var(--r-bg)); }
.article-locked { text-align: center; padding: 1.5rem 0 0; }
.article-locked > i { font-size: 1.6rem; color: var(--r-accent); }
.article-locked h2 { font-size: 1.4rem; margin: .5rem 0; }
.article-locked p { color: var(--r-muted); }
.article-locked .art-sub-box { text-align: start; margin-top: 1rem; }
.art-tags { display: flex; gap: .5rem; flex-wrap: wrap; margin: 2rem 0 0; }
.art-tags a { color: var(--r-muted); text-decoration: none; font-size: .88rem; padding: .25rem .7rem; border-radius: 8px; background: var(--r-surface); border: 1px solid var(--r-line); }
.art-tags a:hover { color: var(--r-accent); border-color: var(--r-accent); }
.art-end { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; padding: 1.2rem 0; border-top: 1px solid var(--r-line); border-bottom: 1px solid var(--r-line); }
.art-react, .art-end-share { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.art-react > span, .art-end-share > span { color: var(--r-muted); font-size: .92rem; font-weight: 700; }
.art-react-btn { display: inline-flex; align-items: center; gap: .45rem; height: 40px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--r-line); background: var(--r-surface); color: var(--r-text); font: inherit; cursor: pointer; transition: all .15s; }
.art-react-btn:hover { border-color: #3DBE8B; color: #3DBE8B; } .art-react-btn.down:hover { border-color: #E5484D; color: #E5484D; }
.art-react-btn.on { background: #3DBE8B; border-color: #3DBE8B; color: #fff; } .art-react-btn.down.on { background: #E5484D; border-color: #E5484D; }
.art-share { display: flex; gap: .4rem; flex-wrap: wrap; }
.art-related { max-width: 1160px; padding-top: 3rem; }
.art-related h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 1.2rem; }
@media (max-width: 991.98px) {
  .art-layout:has(.art-toc) { grid-template-columns: minmax(0, 1fr); max-width: 860px; gap: 1rem; }
  .art-toc details { position: static; max-height: none; }
  .art-toc details:not([open]) { padding-bottom: 1rem; }
}
@media (max-width: 575.98px) {
  .art-head { padding-top: 1.4rem; }
  .art-cover { padding: 0; } .art-cover img { border-radius: 0; }
  .art-body { line-height: 1.95; }
  .art-tools .art-tool[data-font] { display: none; }
}
@media print {
  .art-progress, .art-tools, .art-player, .art-end, .art-sub-box, .art-related, .art-toc, .oc-nav, .footer { display: none !important; }
  .reader { --r-bg: #fff; --r-text: #111; --r-head: #000; --r-muted: #444; background: #fff; }
}
