/* The shell, laid out like a social timeline (js/app.js): a left rail, the page in a 600px middle column between
   hairlines, a right sidebar; on tablets an icon-only rail; on phones a thin top bar, a bottom tab bar and a round
   "new post" button. Also the community's palette: a true black (or white) canvas, grey hairlines, quiet grey
   secondary text, Axon's green kept as the one accent. Loaded after the older sheets, so its tokens win. */

:root {
  --canvas: #000000;
  --s1: #16181c;
  --s2: #1d1f23;
  --s3: #2a2d32;
  --glass: rgba(0, 0, 0, 0.66);
  --line: #2f3336;
  --line-2: #2f3336;
  --hover: rgba(231, 233, 234, 0.06);
  --ink: #e7e9ea;
  --ink-2: #b4b9be;
  --ink-3: #71767b;
  --ink-4: #5b6065;
  --like: #f91880;
  --like-wash: rgba(249, 24, 128, 0.12);
  --ver: #00ba7c;
  --ver-wash: rgba(0, 186, 124, 0.12);
  --reply: #1d9bf0;
  --reply-wash: rgba(29, 155, 240, 0.12);
  --top-h: 0px;
  --rail-w: 275px;
  --col-w: 600px;
  --side-w: 350px;
}
:root[data-theme="light"] {
  --canvas: #ffffff; --s1: #f7f9f9; --s2: #eff3f4; --s3: #e1e8ed; --glass: rgba(255, 255, 255, 0.85);
  --line: #eff3f4; --line-2: #cfd9de; --hover: rgba(15, 20, 25, 0.04);
  --ink: #0f1419; --ink-2: #3c4650; --ink-3: #536471; --ink-4: #8b98a5;
  --like-wash: rgba(249, 24, 128, 0.1); --ver-wash: rgba(0, 186, 124, 0.1); --reply-wash: rgba(29, 155, 240, 0.1);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --canvas: #ffffff; --s1: #f7f9f9; --s2: #eff3f4; --s3: #e1e8ed; --glass: rgba(255, 255, 255, 0.85);
    --line: #eff3f4; --line-2: #cfd9de; --hover: rgba(15, 20, 25, 0.04);
    --ink: #0f1419; --ink-2: #3c4650; --ink-3: #536471; --ink-4: #8b98a5;
    --like-wash: rgba(249, 24, 128, 0.1); --ver-wash: rgba(0, 186, 124, 0.1); --reply-wash: rgba(29, 155, 240, 0.1);
  }
}

body { font-size: 15px; line-height: 1.35; letter-spacing: 0; }
:lang(zh) body, body:lang(zh) { line-height: 1.5; }

/* ------------------------------------------------------------------ the three columns */
.x-app { display: flex; justify-content: center; align-items: flex-start; min-height: 100vh; }
main#main { flex: none; width: var(--col-w); min-width: 0; min-height: 100vh; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
body.is-wide main#main { flex: 0 1 calc(var(--col-w) + var(--side-w) + 30px); width: auto; }
body.is-wide .x-side { display: none; }
body.is-wide main .page { padding-top: 16px; }

/* the left rail */
.x-rail { position: sticky; top: 0; flex: none; width: var(--rail-w); height: 100vh; height: 100dvh; z-index: var(--z-top); }
.x-rail-in { height: 100%; display: flex; flex-direction: column; align-items: flex-start; padding: 2px 12px 12px; overflow-y: auto; scrollbar-width: none; }
.x-logo { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 999px; color: var(--ink); margin: 2px 0; }
.x-logo:hover { background: var(--hover); }
.x-logo .brand-mark { width: 34px; height: 22px; }
.x-nav { display: flex; flex-direction: column; align-items: flex-start; gap: 0; width: 100%; }
.x-nav-a { display: inline-flex; align-items: center; gap: 18px; padding: 12px; border-radius: 999px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 20px; line-height: 24px; cursor: pointer; transition: background var(--t-1) var(--ease); }
.x-nav-a:hover { background: var(--hover); }
.x-nav-a[aria-current="page"] { font-weight: 700; }
.x-nav-ic { position: relative; display: inline-grid; place-items: center; width: 26px; height: 26px; }
.x-nav-ic svg { width: 26px; height: 26px; stroke-width: 1.8; }
.x-nav-a[aria-current="page"] .x-nav-ic svg { stroke-width: 2.5; }
.x-nav-label { white-space: nowrap; padding-right: 12px; }
.x-badge { position: absolute; top: -6px; right: -9px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--canvas); }
.x-post-btn { display: flex; align-items: center; justify-content: center; width: 90%; height: 52px; margin: 16px 0 12px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 17px; font-weight: 700; transition: filter var(--t-1); }
.x-post-btn:hover { filter: brightness(1.08); }
.x-post-ic { display: none; }
.x-post-ic svg { width: 24px; height: 24px; stroke-width: 2.4; }
.x-acct { margin-top: auto; width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; border: 0; border-radius: 999px; background: none; color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.x-acct:hover { background: var(--hover); }
.x-me-av { width: 40px; height: 40px; flex: none; font-size: 16px; background: var(--accent-wash); color: var(--accent-ink); }
.x-me-av.avatar-sm { width: 32px; height: 32px; font-size: 14px; }
.x-acct-names { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 20px; }
.x-acct-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x-acct-handle { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x-acct-dots { color: var(--ink); font-weight: 700; letter-spacing: 1px; }

/* the right sidebar */
.x-side { flex: none; width: var(--side-w); margin-left: 30px; padding-bottom: 64px; position: sticky; top: 0; min-height: 100vh; display: flex; flex-direction: column; gap: 16px; }
.x-side-search { position: sticky; top: 0; z-index: 2; background: var(--canvas); padding: 6px 0 4px; }
.x-search { position: relative; display: flex; align-items: center; }
.x-search svg { position: absolute; left: 16px; width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.x-search input { width: 100%; height: 44px; border-radius: 999px; border: 1px solid transparent; background: var(--s2); color: var(--ink); padding: 0 16px 0 48px; font: inherit; outline: none; }
.x-search input::placeholder { color: var(--ink-3); }
.x-search input:focus { background: var(--canvas); border-color: var(--accent); }
.x-search:focus-within svg { color: var(--accent); }
.x-box { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.x-box-h { padding: 12px 16px; font-size: 20px; font-weight: 800; line-height: 24px; }
.x-box-row { display: block; padding: 12px 16px; color: inherit; transition: background var(--t-1); }
.x-box-row:hover { background: var(--hover); }
.x-box-more { display: block; padding: 16px; color: var(--accent-ink); }
.x-box-more:hover { background: var(--hover); }
.x-trend-ctx, .x-trend-meta { font-size: 13px; color: var(--ink-3); line-height: 16px; }
.x-trend-title { font-weight: 700; line-height: 20px; margin: 2px 0; }
.x-who { display: flex; align-items: center; gap: 12px; }
.x-who-names { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 20px; }
.x-who-names strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x-who-names span { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x-side-foot { padding: 0 16px; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--ink-3); }
.x-side-foot a:hover { text-decoration: underline; }
.x-side .skeleton, .x-side .sk { margin: 12px 16px; }

/* the phone's top bar, tab bar and new-post button */
.x-mtop { display: none; }
.x-fab { display: none; }
@media (min-width: 701px) { .tabbar { display: none !important; } }

/* ------------------------------------------------------------------ a page's own sticky header */
.x-head { position: sticky; top: var(--top-h); z-index: 10; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.x-head-row { display: flex; align-items: center; gap: 24px; min-height: 53px; padding: 0 16px; }
.x-head-row h1, .x-head-row h2 { font-size: 20px; font-weight: 700; line-height: 24px; }
.x-head-sub { font-size: 13px; color: var(--ink-3); line-height: 16px; }
.x-head-titles { display: flex; flex-direction: column; min-width: 0; }
.x-head-titles > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x-back { width: 34px; height: 34px; margin-left: -6px; border-radius: 999px; display: inline-grid; place-items: center; color: var(--ink); flex: none; border: 0; background: none; cursor: pointer; }
.x-back:hover { background: var(--hover); }
.x-back svg { width: 20px; height: 20px; stroke-width: 2.2; }
.x-tabs { display: flex; }
.x-tab { flex: 1; min-width: 56px; height: 53px; padding: 0 16px; background: none; border: 0; color: var(--ink-3); font: inherit; font-weight: 500; cursor: pointer; position: relative; white-space: nowrap; text-align: center; display: inline-flex; align-items: center; justify-content: center; }
.x-tab:hover { background: var(--hover); }
.x-tab[aria-selected="true"] { color: var(--ink); font-weight: 700; }
.x-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); min-width: 56px; width: calc(100% - 32px); max-width: 80px; height: 4px; border-radius: 999px; background: var(--accent); }
.x-tab .x-tab-n { margin-left: 4px; color: var(--ink-3); font-weight: 500; }
.x-tab-label { display: inline-flex; align-items: center; }
/* one bar that slides to the chosen tab, once placed (until then each tab draws its own) */
.x-tabs { position: relative; }
.x-tab-ink { position: absolute; left: 0; bottom: 0; height: 4px; width: 0; border-radius: 999px; background: var(--accent); opacity: 0; pointer-events: none; transition: transform 0.28s cubic-bezier(0.3, 0.7, 0.2, 1), width 0.28s cubic-bezier(0.3, 0.7, 0.2, 1); }
.x-tabs.has-ink .x-tab-ink { opacity: 1; }
.x-tabs.has-ink .x-tab[aria-selected="true"]::after { display: none; }
.x-tab:active .x-tab-label { transform: scale(0.97); }

/* the community's pages fill the column: no page gutter */
body:not(.is-wide) main .page { max-width: none; padding: 0 0 96px; }

/* presses answer: buttons give a little under the finger */
.x-nav-a:active, .x-post-btn:active, .x-fab:active { transform: scale(0.97); }
.x-nav-a, .x-post-btn, .x-fab { transition: background var(--t-1) var(--ease), transform 0.12s var(--ease), filter var(--t-1); }

/* ------------------------------------------------------------------ bare pages hide the shell */
body.is-bare .x-rail, body.is-bare .x-side, body.is-bare .x-mtop, body.is-bare .x-fab, body.is-bare #tabbar { display: none !important; }
body.is-bare main#main { flex: 1 1 auto; width: 100%; border: 0; }
body.is-bare .x-app { display: block; }

/* ------------------------------------------------------------------ widths */
@media (max-width: 1280px) {
  :root { --rail-w: 88px; }
  .x-rail-in { align-items: center; padding: 2px 4px 12px; }
  .x-nav { align-items: center; }
  .x-nav-label, .x-acct-names, .x-acct-dots, .x-post-word { display: none; }
  .x-post-btn { width: 52px; height: 52px; }
  .x-post-ic { display: inline-grid; }
  .x-acct { width: auto; padding: 8px; }
}
@media (max-width: 1080px) { :root { --side-w: 290px; } }
@media (max-width: 1000px) {
  .x-side { display: none; }
  body.is-wide main#main { flex: 1 1 auto; max-width: calc(100vw - var(--rail-w)); }
}
@media (max-width: 700px) {
  :root { --rail-w: 0px; }
  .x-rail { display: none; }
  .x-app { display: block; }
  main#main, body.is-wide main#main { width: 100%; max-width: none; border: 0; min-height: calc(100vh - 53px); }
  body.has-mtop { --top-h: 53px; }
  body.has-mtop .x-mtop { display: block; position: sticky; top: 0; z-index: var(--z-top); height: 53px; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .x-mtop-in { height: 100%; display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; padding: 0 12px; }
  .x-mtop-av { border: 0; background: none; padding: 0; width: 32px; height: 32px; border-radius: 999px; cursor: pointer; }
  .x-mtop-logo { justify-self: center; color: var(--ink); display: grid; place-items: center; }
  .x-mtop-logo .brand-mark { width: 30px; height: 19px; }
  .x-mtop-lang { justify-self: end; border: 0; background: var(--s2); color: var(--ink-2); height: 28px; min-width: 34px; padding: 0 9px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; }
  body:not(.has-mtop) .x-mtop { display: none; }
  /* scrolling down reading, the top bar slides away and the tab bar fades; scrolling up brings them back */
  body.has-mtop .x-mtop { transition: transform 0.22s var(--ease); }
  body.has-mtop.is-hide-top { --top-h: 0px; }
  body.has-mtop.is-hide-top .x-mtop { transform: translateY(-100%); }
  .tabbar { transition: opacity 0.22s var(--ease); }
  body.is-hide-top .tabbar { opacity: 0.45; }
  body.is-hide-top .x-fab { opacity: 0.6; }
  .x-head { transition: top 0.22s var(--ease); }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-top); display: flex; justify-content: space-around; align-items: center;
    height: calc(53px + env(safe-area-inset-bottom)); padding: 0 0 env(safe-area-inset-bottom); background: var(--glass);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); box-shadow: none;
  }
  .tabbar .x-nav-a { flex: 1; justify-content: center; padding: 12px 0; gap: 0; border-radius: 0; font-size: 0; }
  .tabbar .x-nav-a:hover { background: none; }
  .tabbar .x-nav-label { display: none; }
  .tabbar .x-nav-ic, .tabbar .x-nav-ic svg { width: 26px; height: 26px; }
  .tabbar .x-nav-a[aria-current="page"] { color: var(--ink); }
  .x-fab { display: grid; place-items: center; position: fixed; right: 16px; bottom: calc(53px + 16px + env(safe-area-inset-bottom)); z-index: var(--z-top); width: 56px; height: 56px; border-radius: 999px; background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); }
  .x-fab svg { width: 26px; height: 26px; stroke-width: 2.4; }
  body:not(.is-fab) .x-fab { display: none; }
@media (min-width: 701px) { .tabbar { display: none !important; } }
  .page { padding-bottom: 120px; }
}
