
:root{--bg:#fff;--hover:#f7f9f9;--ink:#0f1419;--muted:#536471;--line:#eff3f4;--accent:#1d9bf0}
*{box-sizing:border-box;margin:0}
html{-webkit-text-size-adjust:100%}
body{margin:0;color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;background:var(--bg);line-height:1.5}
.archive-layout{display:flex;justify-content:center;min-height:100vh}
.archive-shell{max-width:600px;width:100%;border-left:1px solid var(--line);border-right:1px solid var(--line);min-height:100vh}
.archive-header{padding:12px 16px;border-bottom:1px solid var(--line)}
.archive-sticky-bar{position:sticky;top:0;z-index:10;background:rgba(255,255,255,.85);backdrop-filter:blur(12px)}
.profile{padding:16px;border-bottom:1px solid var(--line)}
.profile-avatar{width:80px;height:80px;border-radius:50%;object-fit:cover;background:var(--line)}
.profile-name{margin-top:10px;font-size:20px;font-weight:800;line-height:1.2}
.profile-handle{font-size:14px;color:var(--muted)}
.profile-bio{margin:10px 0 0;font-size:15px;line-height:1.45}
.profile-location{display:inline-block;margin-top:8px;font-size:13px;color:var(--muted)}
.profile-stats{display:flex;gap:16px;margin-top:10px;font-size:14px;color:var(--muted)}
.profile-stats strong{color:var(--ink);font-weight:700}
.archive-badge{display:none}
.archive-title{font-size:20px;font-weight:700;line-height:1.3;letter-spacing:normal}
.archive-subtitle{margin:2px 0 0;color:var(--muted);font-size:13px;line-height:1.4}
.tweet{padding:12px 16px;border-bottom:1px solid var(--line);transition:background .15s;cursor:pointer}
.tweet:hover{background:var(--hover)}
h3{font-size:13px;font-weight:400;color:var(--muted)}
p{margin:4px 0 0;font-size:15px;color:var(--ink);line-height:1.5;overflow-wrap:anywhere}
.tweet p:last-child{margin-bottom:4px}
.tweet-media{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:2px;margin:10px 0 4px;border-radius:16px;overflow:hidden}
.tweet-media-item{width:100%}
.tweet-media-item img{display:block;width:100%;height:auto;cursor:zoom-in;background:var(--line);transition:opacity .15s}
.tweet-media-item video{display:block;width:100%;height:auto;background:#000}
.tweet-media-item img:hover{opacity:.88}
.tweet-media-unavailable{color:var(--muted);font-size:14px}
.tweet-ref{margin:10px 0 4px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--bg)}
.tweet-ref p{margin:4px 0 0;font-size:14px;color:var(--ink);line-height:1.45}
.tweet-ref-header{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap}
.tweet-ref-name{font-size:14px;font-weight:700;color:var(--ink)}
.tweet-ref-handle{font-size:13px;color:var(--muted)}
.tweet-ref-time{display:block;margin-top:6px;font-size:12px;color:var(--muted)}
.tweet-ref .tweet-media{margin:8px 0 4px;border-radius:12px}
.tweet-ref-missing{border-style:dashed;background:var(--hover)}
.tweet-ref-missing p{color:var(--muted)}
.tweet-reply-chain{margin:8px 0 4px}
.tweet-reply-chain summary{color:var(--muted);font-size:13px;cursor:pointer}
.tweet-reply-chain[open] summary{margin-bottom:6px}
.tweet-comment{background:var(--hover)}
.tweet-comment-node{position:relative;margin:0 0 8px}
.tweet-comment-node>.tweet-ref{margin:0 0 8px}
.tweet-comment-children{margin-left:9px;padding-left:5px;border-left:2px solid var(--line)}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
.lightbox{position:fixed;inset:0;z-index:1000;display:none;align-items:center;justify-content:center;padding:24px;background:rgba(0,0,0,.7);cursor:pointer}
.lightbox.is-open{display:flex}
.lightbox-image{display:block;max-width:min(100vw - 48px,1400px);max-height:calc(100vh - 48px);border-radius:12px;background:#000}
body.lightbox-open{overflow:hidden}
@media (max-width:600px){.archive-shell{border-left:none;border-right:none}.tweet{padding:10px 16px}.tweet-media{border-radius:12px}}
@media (prefers-color-scheme:dark){:root{--bg:#000;--hover:#080808;--ink:#f7f9f9;--muted:#8b98a5;--line:#2f3336;--accent:#1d9bf0}.archive-sticky-bar{background:rgba(0,0,0,.85)}.tweet-media-item img{background:var(--line)}.lightbox-image{background:var(--bg)}}


.archive-controls{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 4px;padding:12px 16px;border-bottom:1px solid var(--line)}
.archive-toggle{display:inline-flex;align-items:center;gap:10px;padding:6px 14px;border:1px solid var(--line);border-radius:9999px;background:var(--bg);cursor:pointer;user-select:none;transition:background .15s,border-color .15s}
.archive-toggle:hover{background:var(--hover)}
.archive-toggle-input{position:absolute;opacity:0;pointer-events:none}
.archive-toggle-switch{position:relative;width:36px;height:20px;flex:0 0 auto;border-radius:9999px;background:var(--muted);opacity:.35;transition:background .15s,opacity .15s}
.archive-toggle-switch::after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#fff;transition:transform .15s}
.archive-toggle-input:checked+.archive-toggle-switch{background:var(--accent);opacity:1}
.archive-toggle-input:checked+.archive-toggle-switch::after{transform:translateX(16px)}
.archive-toggle-label{font-size:14px;font-weight:500;color:var(--ink)}
.archive-toggle-meta{color:var(--muted);font-size:13px}
@media (max-width:600px){.archive-controls{gap:6px}.archive-toggle{width:100%;justify-content:space-between;padding:8px 12px}.archive-sticky-bar{position:static;background:none;backdrop-filter:none}.archive-tabs{position:sticky;top:0;z-index:10;background:rgba(255,255,255,.85);backdrop-filter:blur(12px)}}
@media (max-width:600px) and (prefers-color-scheme:dark){.archive-tabs{background:rgba(0,0,0,.85)}}
.archive-tabs{display:flex;border-bottom:1px solid var(--line)}
.archive-tab{flex:1;padding:14px 0;border:none;background:none;font-size:15px;font-weight:600;color:var(--muted);cursor:pointer;text-align:center;position:relative;transition:color .15s,background .15s}
.archive-tab:hover{background:var(--hover)}
.archive-tab.active{color:var(--ink)}
.archive-tab.active::after{content:"";position:absolute;bottom:0;left:50%;transform:translateX(-50%);width:56px;height:4px;border-radius:9999px;background:var(--accent)}
.archive-tab-meta{color:var(--muted);font-size:12px;font-weight:400;margin-left:4px}
.tweet-footer{display:flex;justify-content:space-between;align-items:baseline}
.tweet-expand-btn{border:none;background:none;color:var(--accent);font-size:inherit;font-weight:inherit;cursor:pointer;padding:0;line-height:inherit}
.tweet-expand-btn:hover{text-decoration:underline}
.tweet-comments{margin:4px 0}
.tweet-comment-node{position:relative;margin:0 0 8px}
.tweet-comment-node>.tweet-ref{margin:0 0 8px}
.tweet-comment-children{margin-left:9px;padding-left:5px;border-left:2px solid var(--line)}
.detail-panel{display:flex;flex-direction:column;background:var(--bg);overflow:hidden}
.detail-panel-backdrop{position:fixed;inset:0;z-index:99;background:rgba(0,0,0,.25)}
.detail-panel-backdrop[hidden]{display:none}
.detail-panel-header{display:flex;align-items:center;justify-content:space-between;padding:0 12px;border-bottom:1px solid var(--line);flex-shrink:0;min-height:48px}
.detail-panel-title{font-size:16px;font-weight:700;padding:12px 4px}
.detail-panel-close{width:36px;height:36px;border:none;background:none;font-size:22px;color:var(--muted);cursor:pointer;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:background .15s,color .15s}
.detail-panel-close:hover{background:var(--hover);color:var(--ink)}
.detail-panel-body{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:16px}
.detail-context{margin:0 0 12px;padding:0 0 12px 16px;border-left:2px solid var(--line)}
.detail-context .tweet-reply-chain{margin:0}
.detail-context .tweet-reply-chain>summary{display:none}
.detail-context .tweet-ref{margin:0 0 12px;padding:0;border:none;border-radius:0;background:none}
.detail-context .tweet-ref:last-child{margin-bottom:0}
.detail-context .tweet-ref p{font-size:15px;line-height:1.5;overflow-wrap:anywhere}
.detail-context .tweet-ref-name{font-size:15px}
.detail-context .tweet-ref-time{margin-top:4px}
.detail-context .tweet-media-unavailable{color:var(--muted)}
.detail-post h3{font-size:13px;font-weight:400;color:var(--muted)}
.detail-post p{margin:4px 0 0;font-size:15px;color:var(--ink);line-height:1.5;overflow-wrap:anywhere}
.detail-post .tweet-media{display:grid;grid-template-columns:1fr;gap:2px;margin:10px 0 4px;border-radius:16px;overflow:hidden}
.detail-post .tweet-media-item img{display:block;width:100%;height:auto;background:var(--line)}
.detail-post .tweet-media-item video{display:block;width:100%;height:auto;background:#000}
.detail-post .tweet-media-unavailable,.detail-comments .tweet-media-unavailable{color:var(--muted)}
.detail-post .tweet-ref{margin:10px 0 4px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--bg)}
.detail-post .tweet-ref p{font-size:14px}
.detail-post a{color:var(--accent);text-decoration:none}
.detail-post a:hover{text-decoration:underline}
.detail-comments{margin:16px 0 0;padding:16px 0 0;border-top:1px solid var(--line)}
.detail-comments-header{font-size:15px;font-weight:700;color:var(--ink);margin:0 0 12px}
.detail-comments .tweet-ref{margin:0 0 12px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--bg)}
.detail-comments .tweet-ref p{margin:4px 0 0;font-size:14px;color:var(--ink);line-height:1.45}
.detail-comments .tweet-ref-header{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap}
.detail-comments .tweet-ref-name{font-size:14px;font-weight:700;color:var(--ink)}
.detail-comments .tweet-ref-handle{font-size:13px;color:var(--muted)}
.detail-comments .tweet-ref-time{display:block;margin-top:6px;font-size:12px;color:var(--muted)}
.detail-comments .tweet-ref .tweet-media{display:grid;grid-template-columns:1fr;gap:2px;margin:8px 0 4px;border-radius:12px;overflow:hidden}
.detail-comments .tweet-ref .tweet-media-item{overflow:hidden;min-height:0}
.detail-comments .tweet-ref .tweet-media-item img{display:block;width:100%;height:auto;background:var(--line)}
.detail-comments .tweet-ref .tweet-media:has(> :nth-child(2)){grid-template-columns:1fr 1fr;height:200px}
.detail-comments .tweet-ref .tweet-media:has(> :nth-child(2)) img{height:100%;object-fit:cover}
.detail-comments .tweet-ref .tweet-media:has(> :nth-child(3):last-child){grid-template-rows:1fr 1fr}
.detail-comments .tweet-ref .tweet-media:has(> :nth-child(3):last-child)> :first-child{grid-row:1/-1}
.detail-comments .tweet-ref .tweet-media:has(> :nth-child(4):last-child){grid-template-rows:1fr 1fr}
.detail-empty{color:var(--muted);text-align:center;padding:32px 0;font-size:14px}
.detail-note{color:var(--muted);text-align:center;padding:8px 0;font-size:12px}
@media (min-width:601px){.detail-panel{position:sticky;top:0;height:100vh;width:600px;max-width:50vw;flex-shrink:0;border-left:1px solid var(--line)}.detail-panel-backdrop{display:none!important}}
@media (max-width:600px){.detail-panel{position:fixed;bottom:0;left:0;right:0;z-index:100;max-height:80vh;border-radius:16px 16px 0 0;box-shadow:0 -4px 24px rgba(0,0,0,.12);display:none;flex-direction:column}.detail-panel.is-open{display:flex}.detail-panel-body{overscroll-behavior:contain}body.detail-panel-open{overflow:hidden}}
