/* SHARED page style (posts) of 久远澪.com and hisame.live - was inline in /var/www/9on0/posts/bilibili/index.html until 2026-11-13.
   Colours = variables (style.css / this file give 久远澪's; hisame.live overrides them in its theme.css). Edit here, then /opt/site-style/bump-style.sh. */
  /* Public archive of 久远澪00's Bilibili posts. Data: posts.json (made by /opt/bili-posts/publish.py).
     Same colours and fonts as the link page and the recordings page. */
  /* New site style (2026-11-11): shared colours, fonts, corners in /style.css. Months = one card each,
     posts separated by hairlines (like the recordings page). */
  :root {
    --inset: #f3f4ed;        /* repost / link card / poll box inside a post */
    --inset-hover: #ebeee4;
  }
  body { line-height: 1.6; }
  .wrap { max-width: 680px; margin: 0 auto; padding: 36px 16px 60px; }
  h1, h2.month { font-family: var(--serif); font-weight: 600; }

  .top { margin: 0 0 10px; min-height: 28px; display: flex; align-items: center; }
  a.back { color: var(--muted); font-size: 13px; text-decoration: none; }
  a.back:hover { color: var(--accent); }
  header h1 { margin: 0; font-size: 34px; line-height: 1.25; letter-spacing: 1px; }
  header p { margin: 8px 0 0; color: var(--faint); font: 12.5px/1.5 var(--mono); }

  .controls {
    position: sticky; top: 0; z-index: 5;
    background: var(--bar-bg);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    padding: 12px 0; margin: 18px 0 6px;
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    border-bottom: 1px solid var(--line);
  }
  .seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--r); background: var(--card-solid); padding: 2px; }
  .seg button {
    border: 0; background: none; color: var(--text); border-radius: var(--r);
    padding: 5px 12px; font: inherit; font-size: 14px; cursor: pointer;
  }
  .seg button .n { color: var(--muted); font: 11.5px var(--mono); margin-left: 6px; }
  .seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
  .seg button[aria-pressed="true"] .n { color: var(--seg-n-on); }
  input[type=search], select {
    font: inherit; font-size: 14px; color: var(--text);
    border: 1px solid var(--line); background-color: var(--card-solid);   /* -color: keeps the select arrow */
    border-radius: var(--r); padding: 6px 10px;
  }
  input[type=search] { flex: 1 1 100%; min-width: 0; }   /* own line from the start: the counts in the 4 tabs push it there anyway (no jump, 2026-11-12) */
  input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  h2.month {
    margin: 34px 4px 10px; font-size: 21px; line-height: 1.3; letter-spacing: .5px;
    display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline;
  }
  h2.month em { font: normal 12.5px var(--mono); color: var(--faint); letter-spacing: 0; }
  h2.month span {
    font: 400 12px var(--mono); color: var(--muted); letter-spacing: 0; margin-left: auto;
  }
  h2.month.pinned-h { margin-top: 26px; }

  /* One flat rounded box per post */
  .posts {
    display: flex; flex-direction: column; background: var(--card); border-radius: var(--r); overflow: hidden;
    box-shadow: 0 1px 2px rgb(var(--shadow-rgb) / .06);
  }
  .posts > article + article { border-top: 1px solid var(--line-soft); }
  article {
    /* links to #p<id> (calendar, 本周直播): stop below the sticky bar, not under it.
       --bar = the bar's height, set by the script (it wraps to 2 rows on phones) */
    scroll-margin-top: var(--bar, 64px);   /* flush under the bar (user 2026-11-12; was +12px from the separate-card design) */
    padding: 15px 18px 16px;
  }
  article:target { background: var(--accent-soft); }
  .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--muted); font-size: 13px; }
  .meta > a:first-child { font: 12px var(--mono); color: var(--faint); }
  .meta .del { color: var(--muted); border: 1px solid var(--line); border-radius: var(--r); padding: 0 6px; font-size: 12px; line-height: 18px; }
  .meta .kind { }
  .meta .sp { flex: 1; }
  .meta select { font-size: 12.5px; padding: 2px 28px 2px 8px; background-position: right 9px center; border-radius: var(--r); color: var(--muted); max-width: 100%; }
  .meta a { color: var(--muted); text-decoration: none; }
  .meta a:hover { color: var(--accent); }
  .shown-old { margin-top: 8px; font-size: 12.5px; color: var(--muted); }

  .body { margin-top: 6px; }
  .title { font-weight: 600; font-size: 16px; margin: 0 0 4px; }
  .topic { color: var(--ink); font-size: 13.5px; margin: 0 0 2px; }
  .topic a { color: inherit; text-decoration: none; }
  .topic a:hover { text-decoration: underline; }
  .text { white-space: pre-wrap; overflow-wrap: anywhere; }
  .text a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
  .text a:hover { color: var(--accent); text-decoration-color: currentColor; }
  .text img.emo { width: 1.35em; height: 1.35em; vertical-align: -0.3em; margin: 0 1px; }
  .text img.emo.big { width: 1.9em; height: 1.9em; vertical-align: -0.55em; }

  /* Images: one = natural shape; several = square grid. Click opens the full image. */
  .pics { margin-top: 10px; display: grid; gap: 4px; grid-template-columns: repeat(3, 1fr); max-width: 480px; }
  .pics.n2, .pics.n4 { grid-template-columns: repeat(2, 1fr); max-width: 400px; }
  .pics a { display: block; aspect-ratio: 1; border-radius: var(--r); overflow: hidden; background: var(--line); }
  .pics img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .pics.n1 { display: block; }
  .pics.n1 a { aspect-ratio: auto; display: inline-block; max-width: 100%; background: none; }
  .pics.n1 img { width: auto; height: auto; max-width: 100%; max-height: 420px; border-radius: var(--r); }

  /* Video / article: a row like the recordings page (cover on the left) */
  a.card {
    margin-top: 10px; display: flex; gap: 12px; align-items: stretch;
    background: var(--inset); border-radius: var(--r); overflow: hidden; color: var(--text); text-decoration: none;
  }
  a.card:hover { background: var(--inset-hover); }
  a.card .cv { flex: 0 0 150px; aspect-ratio: 16 / 10; background: var(--line); position: relative; }
  a.card .cv img { width: 100%; height: 100%; object-fit: cover; display: block; }
  a.card .cv i {
    position: absolute; right: 5px; bottom: 5px; font: 11px var(--mono); color: #fff;
    background: rgba(0, 0, 0, .55); border-radius: var(--r); padding: 0 5px; font-variant-numeric: tabular-nums;
  }
  a.card .tx { flex: 1; min-width: 0; padding: 8px 12px 8px 0; display: flex; flex-direction: column; justify-content: center; }
  a.card b { font-weight: 600; font-size: 14.5px; line-height: 1.4; }
  a.card span { color: var(--muted); font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

  .extra .poll { list-style: none; margin: 6px 0 2px; padding: 0; color: var(--text); }
  .extra .poll li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-top: 1px solid var(--line); }
  .extra .poll li:first-child { border-top: 0; }
  .extra .poll i { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .extra .pollnote { font-size: 12.5px; }
  .extra { margin-top: 10px; font-size: 13.5px; color: var(--muted); background: var(--inset); border-radius: var(--r); padding: 6px 10px; }

  /* Reposted original */
  .orig { margin-top: 10px; background: var(--inset); border-radius: var(--r); padding: 10px 12px 12px; }
  .orig .who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
  .orig .who img { width: 24px; height: 24px; border-radius: 50%; }
  .orig .who a { color: var(--text); font-weight: 600; text-decoration: none; }
  .orig .who a:hover { color: var(--accent); }
  .orig a.card { background: var(--card-solid); }
  .orig .gone { color: var(--muted); font-size: 14px; }
  .orig .who .del { color: var(--muted); border: 1px solid var(--line); border-radius: var(--r); padding: 0 6px; font-size: 12px; line-height: 18px; }

  .empty { color: var(--muted); text-align: center; padding: 40px 0; }
  footer { margin-top: 44px; }

  @media (max-width: 560px) {
    .wrap { padding-top: 24px; }
    header h1 { font-size: 29px; }
    article { padding: 12px 13px 13px; }
    a.card .cv { flex-basis: 118px; }
  }

  /* Floating 9on0 picture behind the content (same as the recordings page and driedjellyfish.com/me/desmos/) */
  .bouncing-icon {
    position: fixed; top: 0; left: 0;
    width: 150px; height: auto;
    pointer-events: none; user-select: none;
    z-index: -1; will-change: transform;
  }
  @media (prefers-reduced-motion: reduce) { .bouncing-icon { display: none; } }
  @media (max-width: 560px) { .bouncing-icon { width: 100px; } }
