:root {
    --background: #ffffff;
    --text: #333333;
    --muted: #999999;
    --accent: #1fa0ae;
    --line: #eef1f8;
    --footer: #f0f0f0;
    --sidebar: #777777;
    --serif: Georgia, "Times New Roman", serif;
    --sans: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: transparent;
    color: var(--text);
    font-family: "Helvetica Neue", "Microsoft Yahei", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.8;
}

#bg {
    background: #050a10 url("../img/spacejoy.jpg") center / cover no-repeat fixed;
    height: 100%;
    left: 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: -1;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #147f8a; }

.magazine { background: #fff; margin: 0 auto; width: min(1080px, calc(100% - 40px)); }

.site-header { background: #fff; padding: 20px 28px 8px; }
.site-title { font-size: 48px; line-height: 1; margin: 0; text-transform: uppercase; }
.site-title a { color: #333; }
.site-description { color: #a6a6a6; letter-spacing: 2px; margin: 8px 0 16px; text-transform: uppercase; }
#main-navigation { display: flex; flex-wrap: wrap; gap: 4px 18px; }
#main-navigation a { color: #333; padding: 8px 0; text-transform: uppercase; }
#main-navigation a:hover { color: var(--accent); }

.magazine-layout { align-items: flex-start; display: flex; gap: 42px; padding: 34px 0 64px; }
.magazine-main { flex: 1 1 auto; min-width: 0; }
.magazine-sidebar { border-left: 1px solid var(--line); flex: 0 0 250px; padding-left: 24px; }

.section-heading { border-bottom: 1px solid var(--line); margin-bottom: 8px; padding-bottom: 14px; }
.section-kicker { color: var(--accent); font-size: 0.7rem; letter-spacing: 0.2em; margin: 0 0 6px; }
.section-heading h1, .article-header h1 { color: #222222; font-family: var(--serif); font-weight: 700; margin: 0; }
.section-heading h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }

.story-row { display: block; }
.story-index { display: none; }
.story { background: #fff; margin: 0 0 40px; padding: 8px 4px 18px; }
.story-meta, .article-meta { color: #a6a6a6; font-size: 0.9em; margin: 7px 0 12px; text-align: center; text-transform: uppercase; }
.meta-separator { margin: 0 8px; }
.story h2 { font: 700 1.6em/1.2 Arial, Helvetica, sans-serif; margin: 0 0 8px; text-align: center; }
.story h2 a { color: #222222; }
.story h2 a:hover { color: var(--accent); }
.story-summary { color: #555555; margin: 0 0 10px; }
.read-more { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.empty-state, .sidebar-empty { color: var(--muted); }

.pagination { align-items: center; display: flex; gap: 18px; justify-content: space-between; padding: 18px 0; }
.pagination span { color: var(--muted); font-size: 0.8rem; }
.pagination a { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; }

.magazine-sidebar h2 { color: var(--sidebar); font-size: 0.72rem; letter-spacing: 0.16em; margin: 0 0 12px; text-transform: uppercase; }
.sidebar-section { margin-bottom: 28px; }
.sidebar-list, .sidebar-terms { list-style: none; margin: 0; padding: 0; }
.sidebar-list li, .sidebar-terms li { border-bottom: 1px solid var(--line); padding: 7px 0; }
.sidebar-list a { color: #333333; display: block; line-height: 1.35; }
.sidebar-list time { color: var(--muted); display: block; font-size: 0.7rem; }
.sidebar-terms li { align-items: center; display: flex; justify-content: space-between; }
.sidebar-terms a { color: #333333; }
.sidebar-terms li span:last-child { color: var(--muted); font-size: 0.75rem; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-cloud a { border: 1px solid var(--line); color: #555555; font-size: 0.75rem; padding: 2px 7px; }
.tag-cloud a:hover { border-color: var(--accent); color: var(--accent); }

.term-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.term-card { border-top: 2px solid var(--accent); color: var(--text); display: flex; justify-content: space-between; padding: 16px 4px; }
.term-card strong { color: var(--accent); }

.archive-year { border-bottom: 1px solid var(--line); padding: 8px 0 4px; }
.archive-year-heading { align-items: baseline; display: flex; justify-content: space-between; }
.archive-year-heading h2 { font-family: var(--serif); margin: 0; }
.archive-year-heading span { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; }
.archive-year ul { list-style: none; margin: 0; padding: 0; }
.archive-year li { align-items: baseline; display: flex; gap: 16px; padding: 8px 0; }
.archive-year time { color: var(--muted); flex: 0 0 105px; font-size: 0.75rem; }
.archive-year a { color: #222222; font-family: var(--serif); }

.article-header { border-bottom: 1px solid var(--line); margin-bottom: 24px; padding-bottom: 18px; }
.article-header h1 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.1; margin-top: 6px; }
.article-toc { border-left: 3px solid var(--accent); margin: 0 0 24px; padding: 4px 16px; }
.toc-title { font-size: 0.75rem; letter-spacing: 0.12em; margin: 0 0 8px; text-transform: uppercase; }
.article-content { font-size: 1.02rem; }
.article-content h2, .article-content h3, .article-content h4 { font-family: var(--serif); line-height: 1.25; }
.article-content img, .article-content video { height: auto; max-width: 100%; }
.article-content pre { background: #f8f8f8; overflow-x: auto; padding: 16px; }
.article-content code { background: #f8f8f8; padding: 1px 4px; }
.article-content blockquote { border-left: 3px solid var(--accent); color: #666666; margin-left: 0; padding-left: 16px; }
.article-content table { display: block; max-width: 100%; overflow-x: auto; }
.article-footer { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 16px; }
.taxonomy-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.taxonomy-row > span { color: var(--muted); }
.taxonomy-row a { border-bottom: 1px solid var(--accent); }
.article-nav { display: flex; gap: 20px; justify-content: space-between; margin-top: 24px; }
.article-nav a { display: flex; flex: 1; flex-direction: column; }
.article-nav-next { align-items: flex-end; text-align: right; }
.article-nav span { color: var(--muted); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; }
.article-nav strong { color: #222222; font-family: var(--serif); }

.site-footer { background: var(--footer); margin: 0 calc(50% - 50vw); padding: 22px calc(50vw - 50%); }
.footer-inner { align-items: center; color: var(--muted); display: flex; font-size: 0.75rem; gap: 16px; justify-content: space-between; width: min(1080px, calc(100% - 40px)); margin: 0 auto; }
.footer-note { flex: 1; text-align: center; }

@media (max-width: 760px) {
    .magazine { width: min(100% - 28px, 640px); }
    .magazine-layout, .footer-inner, .article-nav, .story-row { display: block; }
    .magazine-sidebar { border-left: 0; border-top: 1px solid var(--line); margin-top: 28px; padding: 24px 0 0; }
    .story-index { padding: 16px 0 0; }
    .article-nav-next { align-items: flex-start; text-align: left; }
    .footer-note { margin: 8px 0; text-align: left; }
    .site-footer { margin: 0; padding: 22px 0; }
}
