/* SHARED page style (calendar) of 久远澪.com and hisame.live - was inline in /var/www/9on0/calendar/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. */
  /* Activity calendar (beta 2026-10-16, public 2026-10-17). Data: data.json (/opt/activity-cal/build.py) */
  :root {
    /* New site style (2026-11-11): shared colours, fonts, corners in /style.css. The event colours
       below are data colours chosen by the user: keep them. */
    --k-stream: #4d7a26;  /* streams (blocks) + planned streams (lines): the green the page always used */
    /* one colour per kind of event (dots in the grid, marks in the list); no orange (rec-page rule) */
    /* posts: Bilibili pink (#fb7299) family, dark -> light = posted, edited, deleted */
    --k-post: #e04b7f;
    --k-edit: #fb7299;
    --k-del: #f8a3c1;     /* deeper since 2026-10-19 (pale dots need no outline) */
    /* Weibo posts (2026-10-19): orange-yellow family (user 2026-10-18), same dark -> light order */
    --k-wb-post: #d99a06;
    --k-wb-edit: #f2bd2c;
    --k-wb-del: #efcf72;
    --k-room: #2a8de0;     /* brighter blue since 2026-10-18 (was #3b78a0) */
    --k-other: #5f6368;    /* 弹幕 / entries in live rooms; neutral grey since 2026-10-18 (violet: too close to the room blue; amber: too close to the planned Weibo orange-yellow) */
    --now-shadow: rgba(40, 60, 20, .35);   /* shadow under the "now" picture */
    --stream-ring: rgba(77, 122, 38, .35); /* ring around a selected stream (= --k-stream at 35%) */
    --stream-tap: rgba(77, 122, 38, .12);  /* tap highlight in the info box */
    --icon-green: #51a132;  /* the green of 9on0.png */
  }
  .wrap { max-width: 860px; margin: 0 auto; padding: 36px 16px 60px; }
  h1 { font-family: var(--serif); font-weight: 600;
       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; border-bottom: 1px solid var(--line);
  }
  .calnav { display: flex; align-items: center; gap: 8px; }
  .calnav button, .kinds button {
    font: inherit; font-size: 14px; color: var(--text); cursor: pointer;
    border: 1px solid var(--line); background: var(--card-solid); border-radius: var(--r); padding: 4px 11px;
  }
  .calnav button:disabled { opacity: .4; cursor: default; }
  .calnav .pager { display: inline-flex; flex: 0 0 auto; }
  .calnav .pager button { width: 38px; height: 31px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
  .calnav .pager .chev { width: 7px; height: 11px; }
  .calnav .pager button:first-child { border-radius: var(--r) 0 0 var(--r); }
  .calnav .pager button:last-child { border-radius: 0 var(--r) var(--r) 0; margin-left: -1px; }
  .calnav .wk { margin: 0 6px; font: 500 13.5px var(--mono); min-width: 0; }
  .calnav .wk .short { display: none; }
  .calnav .latest { margin-left: auto; flex: 0 0 auto; }
  /* Kind filters: each one on/off */
  .kinds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
  .kinds button { display: inline-flex; align-items: center; gap: 0 6px; font-size: 13px; padding: 3px 10px; color: var(--muted); }
  .kinds button i { width: 12px; height: 3px; border-radius: 2px; background: currentColor; opacity: .35; flex: 0 0 auto; }
  .kinds button[aria-pressed="true"] { color: var(--text); background: #fff; border-color: var(--muted); }
  .kinds button[aria-pressed="true"] i { opacity: 1; }
  .kinds button[data-k="stream"] i { color: var(--k-stream); height: 9px; }
  /* chips of dot kinds: dots like in the grid; 动态 / 微博 = posted, edited, deleted (three dots) */
  .kinds button i.d { width: 7px; height: 7px; border-radius: 50%; }
  .kinds button i.d + i.d { margin-left: -3px; }
  .kinds button[data-k="room"] i { color: var(--k-room); }
  .kinds button[data-k="dm"] i { color: var(--k-other); }

  /* Week grid (from the rec page calendar): 24 h tall, one column per day */
  .cal { margin-top: 6px; --hr: 28px; background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: 0 1px 2px rgb(var(--shadow-rgb) / .06); }
  .cal-head, .cal-body { display: grid; grid-template-columns: 46px repeat(7, 1fr); }
  .cal-head { border-bottom: 1px solid var(--line-soft); }
  .cal-body { border-bottom: 1px solid var(--line-soft); height: calc(24 * var(--hr)); }
  .cal-head div { padding: 8px 0 7px; text-align: center; font-size: 13px; color: var(--muted); line-height: 1.3; }
  .cal-head b { display: block; font: 500 15px/1.5 var(--mono); color: var(--text); }
  .cal-head .today { background: var(--accent-soft); }
  .cal-head .today b { color: var(--accent); font-weight: 700; }
  .hours { position: relative; }
  .hours span { position: absolute; right: 7px; transform: translateY(-50%); font: 10.5px var(--mono); color: var(--faint); }
  .day {
    position: relative; border-left: 1px solid var(--line-soft);
    background: repeating-linear-gradient(to bottom, transparent 0 calc(var(--hr) - 1px), var(--line-soft) calc(var(--hr) - 1px) var(--hr));
  }
  /* now: the 9on0 picture, small, in the middle of today's column, sitting on a line in its green */
  .day .now { position: absolute; left: 0; right: 0; height: 22px; margin-top: -11px; z-index: 4; }  /* picture + both lines = one hover target */
  .day .now::before, .day .now::after { content: ""; position: absolute; top: 10px; height: 2px; background: var(--icon-green); }
  .day .now::before { left: 0; right: calc(50% + 15px); }
  .day .now::after { right: 0; left: calc(50% + 15px); }
  .day .now img { position: relative; display: block; width: 22px; height: 22px; margin: 0 auto; object-fit: contain; filter: drop-shadow(0 1px 2px var(--now-shadow)); }
  .ev { position: absolute; left: 3px; right: 3px; min-height: 3px; border-radius: 2px; display: block; }
  a.ev.stream { background: var(--k-stream); opacity: .82; }
  a.ev.stream.norec { cursor: default; }   /* no recording: times from danmakus.com (2026-11-08) */
  .ev.on { opacity: 1 !important; box-shadow: 0 0 0 2px var(--stream-ring); }
  /* Everything without a known length is a horizontal line across the day: an invisible
     9 px tall hit area with the 2 px line in the middle */
  .mark { position: absolute; left: 2px; right: 2px; height: 9px; margin-top: -4.5px; z-index: 2; display: flex; }
  /* one segment per kind in the line (a line can hold several kinds, like calendar apps do) */
  .mark .s { flex: 1; position: relative; display: block; cursor: pointer; }
  .mark .s::before { content: ""; position: absolute; left: 0; right: 0; top: 3.5px; height: 2px; background: var(--c); }
  .mark .s:first-child::before { border-radius: 1px 0 0 1px; }
  .mark .s:last-child::before { border-radius: 0 1px 1px 0; }
  .mark .s + .s::before { left: 1px; }   /* 1 px gap between the events of a line, any kinds (user 2026-10-18) */
  .mark .plan { --c: var(--k-stream); cursor: default; }
  /* Events are DOTS in fixed lanes (user 2026-10-19; were lines across the day): Bilibili posted /
     edited / deleted, then Weibo posted / edited / deleted, then room changes and 其他活动 on the right.
     Same-lane events close together are one dot (a bit bigger), listed together in the info box. */
  .cal { --d: 8px; }
  .dot {
    position: absolute; width: var(--d); height: var(--d); margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2);
    border-radius: 50%; background: var(--c); z-index: 3; display: block;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .85); transition: transform .12s;
  }
  /* all dots one size, no outlines (user 2026-10-19, style "A": calmer, no hole look) */
  .dot::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; }   /* easier to hit */
  .dot.on { transform: scale(1.6); z-index: 5; }
  .post { --c: var(--k-post); }
  .edit { --c: var(--k-edit); }
  .delete { --c: var(--k-del); }
  .wbpost { --c: var(--k-wb-post); }
  .wbedit { --c: var(--k-wb-edit); }
  .wbdelete { --c: var(--k-wb-del); }
  .room { --c: var(--k-room); }
  .dm { --c: var(--k-other); }
  .mark .s.on::before { top: 2.5px; height: 4px; }
  .kinds button i.d { background: var(--c); }
  .calnote { margin: 10px 2px 0; font: 11.5px var(--mono); color: var(--faint); }

  .empty, .error { text-align: center; color: var(--muted); padding: 30px 0; }
  .error { color: #9b2c1f; }

  .tip {
    position: fixed; z-index: 20; max-width: 280px; pointer-events: none;
    padding: 9px 11px; border-radius: var(--r); background: #fff; box-shadow: 0 6px 24px rgb(var(--shadow-rgb) / .2);
    font-size: 13px; line-height: 1.5; overflow-wrap: anywhere;
  }
  .tip[hidden] { display: none; }
  .tip .m { color: var(--muted); font-variant-numeric: tabular-nums; }
  /* what an edit changed: removed text crossed out, the new text right after it */
  .tip del { color: var(--muted); }
  .tip ins { text-decoration: none; color: var(--k-post); font-weight: 600; }
  .tip .hint { color: var(--accent); margin-top: 2px; }
  /* Computers: hovering shows the box as a preview that ignores the mouse (it must not cover the
     next dots, user 2026-10-19); clicking a dot with several events pins it (.pin) so one can be
     picked. Phones (.touch): a tap shows it and the box / each entry is the link. */
  .tip.pin, .tip.touch { pointer-events: auto; }
  .tip a.sec { display: block; color: inherit; text-decoration: none; -webkit-tap-highlight-color: var(--stream-tap); }
  .tip.pin .multi a.sec .go, .tip.touch .multi a.sec .go { display: block; color: var(--accent); }
  .tip .choose { color: var(--accent); margin-top: 7px; }
  .tip.pin .choose, .tip.touch .choose { display: none; }
  .tip a.sec:hover .go, .tip a.sec:hover .hint { text-decoration: underline; }
  .tip .go { display: none; }
  .tip .lines div { line-height: 1.45; }
  /* long 其他活动 lists (user 2026-11-22): preview = first 8 lines + "… 共 N 条"; pinned / phone box =
     every line, scrolling inside the box (contain: the page behind doesn't scroll and close the box) */
  .tip:not(.pin):not(.touch) .lines.more div:nth-child(n+9) { display: none; }
  .tip.pin .lines.more, .tip.touch .lines.more { max-height: min(50vh, 320px); overflow-y: auto; overscroll-behavior: contain; }
  .tip.pin .cut, .tip.touch .cut { display: none; }
  .tip:not(.pin):not(.touch) .sec:has(.cut) .hint { display: none; }   /* the click pins instead of opening */
  .tip hr { border: 0; border-top: 1px solid var(--line-soft); margin: 7px 0; }
  .tip .sec + .sec { border-top: 1px solid var(--line-soft); margin-top: 7px; padding-top: 7px; }

  .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; } }

  footer { margin-top: 44px; }
  button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  @media (max-width: 560px) {
    .wrap { padding-top: 24px; }
    h1 { font-size: 27px; }
    .bouncing-icon { width: 100px; }
    .calnav .wk .long { display: none; }
    .calnav .wk .short { display: inline; }
    .cal { --hr: 16px; }
    .cal-head, .cal-body { grid-template-columns: 40px repeat(7, 1fr); }   /* 40: room for the mono hour labels (34 touched the border) */
    .cal-head div { padding: 6px 0 5px; font-size: 12px; }
    .cal-head b { font-size: 15px; }
    .cal-head b .mo { display: none; }  /* phones: day number only (the week label has the month) */
    .hours span { right: 5px; font-size: 10px; }
    .ev { left: 2px; right: 2px; }
    .day .now { height: 18px; margin-top: -9px; }
    .day .now::before, .day .now::after { top: 8px; }
    .day .now::before { right: calc(50% + 13px); }
    .day .now::after { left: calc(50% + 13px); }
    .day .now img { width: 18px; height: 18px; }
    .cal { --d: 5px; }
    .dot::after { inset: -4px; }
  }
  /* stream time of the shown week (2026-11-16); min-height keeps the grid from jumping */
  .wsum { margin: 8px 2px 10px; min-height: 1.5em; font-size: 13px; color: var(--muted); }
  .wsum b { font: 500 13px var(--mono); color: var(--text); margin: 0 1px; }
  .wsum .on { color: var(--k-stream); }
