/* 星海航纪 (InterImm magazine): only what this site adds to the shared InterImm kit
   (https://interimm.org/kit/). Colours come from the kit tokens so light and dark both work. */

/* ---------- the magazine's own bar under the shared header ---------- */
.mag-bar { border-bottom: 1px solid var(--border); background: var(--bg); }
.mag-bar-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1.5rem; min-height: 3rem; padding-block: 0.4rem; }
.mag-name { display: inline-flex; align-items: baseline; gap: 0.5rem; color: var(--text); text-decoration: none; }
.mag-title { font-family: var(--font-display); font-size: 1.1rem; letter-spacing: 0.08em; }
.mag-issue { padding: 0 0.4rem; border: 1px solid var(--accent); border-radius: 999px; color: var(--accent); font-family: var(--font-mono); font-size: 0.72rem; line-height: 1.4; }
.mag-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.mag-links a { color: var(--muted); font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 0.12em; text-decoration: none; }
.mag-links a:hover, .mag-links a[aria-current="page"] { color: var(--text); }
.mag-links a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 0.35em; }

/* ---------- home: the cover ---------- */
.mag-cover-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; gap: 2rem 3.5rem; }
.mag-cover h1 { letter-spacing: 0.12em; }
.mag-cover-plate { margin: 0; }
.mag-cover-plate .plate-frame { padding: 0; background: none; }
@media (max-width: 52rem) {
  .mag-cover-grid { grid-template-columns: 1fr; }
}

/* the featured (latest) article */
.mag-feature { display: block; max-width: var(--measure); margin-top: 1.75rem; padding: 1.1rem 1.25rem; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.mag-feature:hover { border-color: var(--border-strong); border-left-color: var(--accent); }
.mag-feature .kicker { display: block; margin-bottom: 0.35rem; }
.mag-feature-title { display: block; font-family: var(--font-display); font-size: 1.35rem; font-weight: 400; line-height: 1.3; }
.mag-feature-summary { display: block; margin-top: 0.4rem; color: var(--muted); font-size: 0.95rem; line-height: 1.6; }

/* ---------- article lists ---------- */
.mag-list { max-width: 52rem; margin: 1.5rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--border-strong); }
.mag-list > li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.25rem 1.5rem; padding: 1.1rem 0; border-bottom: 1px solid var(--border); }
.mag-list time { margin-top: 0.35rem; }
.mag-list h3 { margin: 0 0 0.3rem; font-size: 1.2rem; line-height: 1.4; }
.mag-list h3 a { color: var(--text); text-decoration: none; }
.mag-list h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 0.25em; }
.mag-list p { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.65; }
@media (max-width: 36rem) { .mag-list > li { grid-template-columns: 1fr; } }
.mag-empty { color: var(--muted); }
.mag-archive.section { padding-top: clamp(1rem, 3vw, 2rem); }
.mag-archive-body > p { max-width: var(--measure); color: var(--muted); }
.mag-archive-body > .mag-feature { margin-top: 0; }

/* ---------- articles ---------- */
.mag-article .doc-side { align-self: start; }
@media (min-width: 52rem) { .mag-article .doc-side { position: sticky; top: 1.5rem; } }
.toc ol { margin: 0.5rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.toc li { border-bottom: 1px solid var(--border); }
.toc a { display: block; padding: 0.45rem 0; color: var(--muted); font-size: 0.9rem; line-height: 1.4; text-decoration: none; }
.toc a:hover, .toc a[aria-current] { color: var(--text); }
.toc a[aria-current] { box-shadow: inset 2px 0 0 var(--accent); padding-left: 0.6rem; }
@media (max-width: 52rem) { .toc ol { columns: 2; column-gap: 1.5rem; } .toc li { break-inside: avoid; } }

.prose figure { display: flex; flex-direction: column; margin: 2rem 0; }
.prose figure img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.prose figure p { margin: 0; }
.prose figcaption { order: 2; margin-top: 0.5rem; color: var(--muted); font-family: var(--font); font-size: 0.9rem; line-height: 1.6; }
.prose img { max-width: 100%; height: auto; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.95rem; }
.prose th, .prose td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); text-align: left; }
.prose blockquote { margin: 1.5rem 0; padding-left: 1.25rem; border-left: 2px solid var(--accent); color: var(--muted); }
.prose .footnotes { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.prose .footnotes p, .prose .footnotes li { font-size: 0.95rem; line-height: 1.6; }
.prose pre { overflow-x: auto; padding: 1rem 1.25rem; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.6; }
.prose :not(pre) > code { padding: 0.1em 0.35em; background: var(--bg-alt); border-radius: 3px; font-family: var(--font-mono); font-size: 0.88em; }
.prose mjx-container { overflow-x: auto; overflow-y: hidden; max-width: 100%; }
.highlight .c, .highlight .c1, .highlight .cm { color: var(--muted); font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn { color: var(--accent); }
.highlight .s, .highlight .s1, .highlight .s2 { color: var(--link); }

/* the author card at the end of an article */
.mag-author { display: flex; gap: 1.25rem; align-items: flex-start; max-width: var(--measure); margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border-strong); }
.mag-author-image { flex: none; width: 4rem; height: 4rem; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); background: var(--surface); }
.mag-author .kicker { margin: 0 0 0.25rem; }
.mag-author-name { margin: 0 0 0.35rem; font-size: 1.25rem; }
.mag-author-bio { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.65; }
.mag-author-bio b { color: var(--text); font-weight: 500; }
.mag-author-links { display: flex; gap: 1.25rem; margin: 0.6rem 0 0; font-size: 0.9rem; }

/* article body starts right under its header */
.mag-article.section { padding-top: clamp(1rem, 3vw, 2rem); }
.prose iframe { max-width: 100%; border: 1px solid var(--border); }
/* Flash players (2014 Youku / Bilibili embeds) no longer play in any browser; hide the empty boxes. */
.prose embed[src$=".swf"], .prose embed[type="application/x-shockwave-flash"] { display: none; }
.mag-list:not(:has(li)) { display: none; }
.mag-archive-body hr { max-width: 52rem; margin: 2.5rem 0 1.5rem; border: 0; border-top: 1px solid var(--border); }
