* { box-sizing: border-box; }
:root { color-scheme: light dark; --bg: #f4f1ea; --surface: #fff; --text: #222; --muted: #666; --border: #999; --link: #0645ad; --visited: #551a8b; --notice: #ffffd8; --error: #ffe0e0; --button: #eee; --button-hover: #ddd; --image-bg: #ddd; --accent: #0645ad; }
@media (prefers-color-scheme: dark) { :root { --bg: #171717; --surface: #222; --text: #eee; --muted: #aaa; --border: #555; --link: #8ab4ff; --visited: #c58cff; --notice: #3a3718; --error: #401f1f; --button: #333; --button-hover: #444; --image-bg: #111; --accent: #8ab4ff; } }
html { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
body { margin: 0; min-height: 100vh; overflow-x: hidden; }
a { color: var(--link); }
a:visited { color: var(--visited); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
header { background: var(--surface); border-bottom: 1px solid var(--border); }
nav { max-width: 1200px; margin: 0 auto; padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left)); display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
nav .brand { font-weight: bold; font-size: 1.25rem; color: var(--text); text-decoration: none; margin-right: 12px; }
main { width: min(1200px, 100%); margin: 0 auto; padding: 24px clamp(12px, 3vw, 24px) 48px; }
h1, h2, h3 { margin-top: 0; }
.box { background: var(--surface); border: 1px solid var(--border); padding: clamp(12px, 2vw, 16px); margin: 16px 0; border-radius: 8px; }
.notice { background: var(--notice); border: 1px solid var(--border); padding: 10px; }
.error { background: var(--error); border: 1px solid var(--border); padding: 10px; }
form label { display: block; font-weight: bold; margin: 12px 0 4px; }
input, textarea, select { width: 100%; max-width: 640px; padding: 9px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); color: var(--text); font: inherit; }
textarea { min-height: 120px; }
button, .button { display: inline-block; margin-top: 12px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 5px; background: var(--button); color: var(--text); font: inherit; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: var(--button-hover); }
code, pre, kbd, samp { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: clamp(10px, 2vw, 16px); }
.post-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.card { min-width: 0; background: var(--surface); border: 1px solid var(--border); padding: 10px; border-radius: 8px; }
.post-grid .card { padding: 5px; border-radius: 6px; overflow: hidden; }
.card img { display: block; width: 100%; height: auto; max-height: 70vh; aspect-ratio: 1; object-fit: cover; background: var(--image-bg); border-radius: 4px; }
.post-grid .card img { aspect-ratio: 1; border-radius: 3px; }
.post-grid .card h2 { margin: 6px 2px 2px; font-size: .85rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.post-grid .card .meta { margin: 0 2px 4px; font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-grid .card > a:last-child { display: block; margin: 0 2px 4px; font-size: .75rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { color: var(--muted); font-size: .9rem; }
.tags a { margin-right: 8px; }
.custom-emoji { display: inline-block; width: 1.35em; height: 1.35em; object-fit: contain; vertical-align: -.3em; }
.profile { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: start; border-left: 4px solid var(--profile-accent, var(--accent)); padding-left: 12px; }
.profile-banner { display: block; width: 100%; max-height: 280px; object-fit: cover; border-radius: 6px; margin-bottom: 16px; }
.avatar { width: 96px; height: 96px; object-fit: cover; border-radius: 50%; background: var(--image-bg); border: 1px solid var(--border); }
.profile-links { display: flex; gap: 12px; flex-wrap: wrap; }
.widget-heading { display: flex; align-items: center; gap: 6px; }
.widget-heading h2 { margin-right: auto; margin-bottom: 0; }
.widget-heading button { margin-top: 0; padding: 4px 9px; }
.post-image { display: block; width: auto; max-width: 100%; max-height: min(85vh, 1600px); height: auto; margin: 0 auto; border-radius: 4px; }
.post-media { margin: 16px 0; text-align: center; overflow: hidden; }
.post-media a { display: block; max-width: 100%; }
.post-media figcaption { margin-top: 6px; font-size: .9rem; }
.caption { font-size: 1.05rem; white-space: pre-wrap; }
.reactions { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.reactions button { margin-top: 0; }
.reactions button[aria-pressed="true"] { font-weight: bold; outline: 2px solid var(--accent); }
.comment-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.comment-actions button { margin-top: 0; padding: 5px 9px; font-size: .9rem; }
progress { display: block; width: min(640px, 100%); height: 1rem; margin-top: 8px; }
footer { width: min(1200px, 100%); margin: 0 auto; padding: 16px clamp(12px, 3vw, 24px); border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; }
@media (min-width: 960px) { .page-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 320px); gap: 24px; align-items: start; } .sidebar { position: sticky; top: 16px; min-width: 0; } }
@media (max-width: 1100px) { .post-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 700px) { nav { gap: 10px; } nav .brand { width: 100%; margin-right: 0; } main { padding-top: 16px; } .profile { grid-template-columns: 64px minmax(0, 1fr); } .avatar { width: 64px; height: 64px; } .post-image { max-height: 75vh; } .post-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; } }
@media (max-width: 480px) { .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; } }
@media (max-width: 420px) { nav { font-size: .9rem; } .grid:not(.post-grid) { grid-template-columns: 1fr; } .reactions button { flex: 1 1 100%; } }
@media (max-width: 360px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; } }