/* Vmus.net studies — shared stylesheet (studies/_shared/study.css)
   One stylesheet for the catalogue page (studies/index.html) and every study page (studies/<slug>/index.html). */
:root {
  --ink: #1f2230;
  --ink-2: #4a4f60;
  --muted: #6b7183;
  --line: #e3e0ee;
  --line-2: #efedf6;
  --bg: #f6f5fa;
  --card: #ffffff;
  --brand: #2a1d82;
  --brand-2: #3d2b9e;
  --brand-soft: #efeafd;
  --gold: #b8932a;
  --accent: #c2410c;
  --ok: #15803d;
  --warn: #9a3412;
  --warn-bg: #fff7ed;
  --shadow: 0 1px 2px rgba(20, 16, 60, .06), 0 4px 16px rgba(20, 16, 60, .06);
  --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", SimSun, Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.65 var(--sans); -webkit-text-size-adjust: 100%; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }
img { max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1240px; margin: 0 auto; padding: 0 20px; height: 54px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: baseline; gap: 10px; color: var(--ink); font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.brand b { color: var(--brand); font-size: 17px; }
.brand span { color: var(--muted); font-weight: 500; font-size: 14px; }
.brand:hover { text-decoration: none; }
.topnav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: nowrap; min-width: 0; }
.topnav a { color: var(--ink-2); padding: 6px 10px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
.topnav a:hover { background: var(--line-2); text-decoration: none; }
.lang { display: inline-flex; flex-shrink: 0; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-left: 6px; }
.lang button { border: 0; background: transparent; padding: 3px 10px; font-size: 13px; color: var(--muted); cursor: pointer; }
.lang button.on { background: var(--brand); color: #fff; }

/* ---------- layout ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
section.block { padding: 44px 0 8px; }
.block-title { font-size: 22px; font-weight: 750; margin: 0 0 6px; letter-spacing: .01em; }
.block-lead { color: var(--muted); margin: 0 0 20px; max-width: 880px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.prose { max-width: 880px; }
.prose p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tag { display: inline-block; font-size: 12px; padding: 1px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.gray { background: var(--line-2); color: var(--ink-2); }

/* ---------- hero ---------- */
.hero { background: linear-gradient(135deg, #22176b 0%, #2f1f8a 45%, #4b2aa3 100%); color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(900px 300px at 85% 10%, rgba(184, 147, 42, .22), transparent 60%); pointer-events: none; }
.hero-in { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 46px 20px 40px; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 36px; align-items: center; }
.eyebrow { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #e9d9a6; font-weight: 700; margin-bottom: 10px; }
.hero h1 { font: 700 34px/1.25 var(--serif); margin: 0; letter-spacing: .01em; text-wrap: balance; }
.hero .subtitle { font: 500 19px/1.5 var(--serif); margin: 8px 0 0; color: #ece8ff; }
.hero .byline { margin-top: 18px; color: #dcd6fb; font-size: 15px; }
.hero .byline b { color: #fff; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.stat { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; padding: 7px 12px; min-width: 86px; }
.stat b { display: block; font-size: 20px; line-height: 1.2; white-space: nowrap; }
.stat span { font-size: 12px; color: #d9d3fa; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 10px; padding: 8px 16px; font-size: 14px; font-weight: 650; border: 1px solid transparent; cursor: pointer; text-decoration: none !important; }
.btn.primary { background: #f3d77a; color: #2a1d82; }
.btn.primary:hover { background: #f7e3a3; }
.btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.btn.ghost:hover { background: rgba(255, 255, 255, .1); }
.btn.line { background: #fff; color: var(--brand); border-color: var(--line); }
.btn.line:hover { background: var(--brand-soft); }
.hero-figure { background: rgba(255, 255, 255, .96); border-radius: 12px; padding: 10px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.hero-figure img { display: block; width: 100%; border-radius: 6px; }
.hero-figure figcaption { color: #3b3f4f; font-size: 12px; margin-top: 6px; }

/* ---------- findings / method / timeline cards ---------- */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.finding { padding: 18px 20px; }
.finding h3 { margin: 0 0 8px; font-size: 16px; }
.finding .chap { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.finding ul { margin: 8px 0 0; padding-left: 18px; }
.finding li { margin: 6px 0; }
.method { padding: 16px 18px 18px; display: flex; flex-direction: column; }
.method h3 { margin: 0 0 6px; font-size: 16px; }
.method img { border: 1px solid var(--line-2); border-radius: 8px; margin: 6px 0 10px; background: #fff; cursor: zoom-in; }
.method .v3 { margin-top: auto; font-size: 13px; color: var(--ink-2); background: var(--brand-soft); border-radius: 8px; padding: 8px 10px; }
.timeline { position: relative; margin-left: 8px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 22px 32px; }
.tl-item::before { content: ""; position: absolute; left: 1px; top: 7px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); }
.tl-item.now::before { background: var(--gold); border-color: var(--gold); }
.tl-year { font-weight: 750; color: var(--brand); }
.tl-item h4 { margin: 0 0 4px; font-size: 16px; }
.tl-item p { margin: 0; color: var(--ink-2); max-width: 920px; }
.tl-item .shots { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.tl-item .shots img { width: 260px; max-width: 100%; border: 1px solid var(--line); border-radius: 8px; cursor: zoom-in; }

/* ---------- case browser ---------- */
.browser { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; align-items: start; }
.tree { position: sticky; top: 66px; max-height: calc(100vh - 80px); overflow: auto; padding: 10px 8px; }
.tree h4 { margin: 12px 8px 6px; font-size: 12px; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }
.tree h4:first-child { margin-top: 2px; }
.tree button { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 6px; width: 100%; text-align: left; border: 0; background: transparent; padding: 6px 8px; border-radius: 8px; cursor: pointer; color: var(--ink); font-size: 13.5px; line-height: 1.35; }
.tree button:hover { background: var(--line-2); }
.tree button.on { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.tree button .n { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; padding-top: 1px; }
.tree button.on .n { color: var(--brand); }
.tree-select { display: none; width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 15px; }
.detail { padding: 22px 24px 26px; min-height: 420px; }
.case-head .n { font-size: 13px; color: var(--muted); font-weight: 650; letter-spacing: .02em; }
.case-head h3 { margin: 2px 0 4px; font: 700 22px/1.35 var(--serif); }
.case-head .excerpt { color: var(--ink-2); }
.case-head .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 18px 0 14px; }
.tabs button { border: 0; background: transparent; padding: 8px 12px; border-bottom: 2px solid transparent; cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.controls { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 10px; font-size: 13px; color: var(--ink-2); }
.controls .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.controls .seg button { border: 0; background: #fff; padding: 4px 9px; cursor: pointer; font-size: 12.5px; color: var(--ink-2); }
.controls .seg button + button { border-left: 1px solid var(--line); }
.controls .seg button.on { background: var(--brand); color: #fff; }
.controls label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.controls input[type=number] { width: 64px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; max-width: 100%; height: auto; overflow: hidden; }
.chart .tip { position: absolute; pointer-events: none; background: rgba(28, 25, 52, .92); color: #fff; font-size: 12px; padding: 5px 8px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -110%); display: none; z-index: 5; }
.panel-cap { font-size: 12.5px; color: var(--ink-2); margin: -2px 0 10px; }
.panel-cap b { color: var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 6px 0 4px; font-size: 13px; }
.legend button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; background: #fff; padding: 2px 10px 2px 6px; cursor: pointer; color: var(--ink); }
.legend button i { width: 18px; height: 3px; border-radius: 2px; display: inline-block; }
.legend button.off { opacity: .4; }
.claims { margin: 16px 0 6px; }
.claims h4, .summary h4, .recs h4, .figs h4 { font-size: 14px; margin: 18px 0 8px; color: var(--ink-2); letter-spacing: .02em; }
.claim { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.claim:hover { background: var(--line-2); }
.claim.on { background: #fff8e1; border-color: #f1d98b; }
.claim .bars { font-size: 12px; color: var(--brand); font-weight: 700; font-variant-numeric: tabular-nums; padding-top: 2px; }
.claim .src { font-size: 11.5px; color: var(--muted); margin-left: 6px; }
.summary p { margin: 0 0 10px; }
.summary-wrap .more { border: 0; background: none; color: var(--brand-2); cursor: pointer; padding: 2px 0; font-weight: 600; font-size: 13.5px; }
table.rt { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.rt th { text-align: left; font-weight: 650; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); padding: 6px 8px; white-space: nowrap; }
table.rt td { border-bottom: 1px solid var(--line-2); padding: 7px 8px; vertical-align: top; }
table.rt td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.rt .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.linkrow { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.linkrow a { font-size: 12.5px; white-space: nowrap; }
/* 1.3.1: links to 跟大师练 and 节拍闯关, filled in once their files are read */
.xl:empty { display: none; }
.figs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.fig { margin: 0; }
.fig .stack { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 6px; cursor: zoom-in; max-height: 380px; overflow: hidden; position: relative; }
.fig .stack img { display: block; width: 100%; }
.fig .stack .count { position: absolute; right: 8px; bottom: 8px; background: rgba(28, 25, 52, .78); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 999px; }
.fig figcaption { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }
.ioi-block { margin-bottom: 26px; }
.ioi-block .score { position: relative; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 6px 0; }
.ioi-block .score img { display: block; width: 100%; }
.note { font-size: 12.5px; color: var(--ink-2); background: var(--line-2); border-radius: 8px; padding: 8px 10px; margin: 10px 0; }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.empty { color: var(--muted); padding: 30px 0; text-align: center; }

/* ---------- data / cite ---------- */
.kv { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 8px 18px; }
.kv dt { color: var(--muted); font-size: 13.5px; }
.kv dd { margin: 0; }
.cite { padding: 16px 18px; font-size: 14px; }
.cite pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.55 var(--mono); background: var(--line-2); border-radius: 8px; padding: 10px 12px; margin: 8px 0 0; }
.copy { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; color: var(--brand); }
footer.foot { margin-top: 50px; padding: 26px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* ---------- catalogue ---------- */
.cat-hero { background: linear-gradient(135deg, #22176b, #3d2b9e); color: #fff; }
.cat-hero .wrap { padding-top: 40px; padding-bottom: 34px; }
.cat-hero h1 { font: 700 30px/1.3 var(--serif); margin: 0 0 8px; }
.cat-hero p { color: #e4defc; max-width: 760px; margin: 0; }
.cat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; padding-top: 28px; padding-bottom: 28px; }
.study-card { display: flex; flex-direction: column; overflow: hidden; color: var(--ink); }
.study-card:hover { text-decoration: none; box-shadow: 0 2px 4px rgba(20, 16, 60, .08), 0 12px 30px rgba(20, 16, 60, .12); }
.study-card .cover { aspect-ratio: 16 / 7; background: #fff center / cover no-repeat; border-bottom: 1px solid var(--line); }
.study-card .body { padding: 16px 18px 18px; }
.study-card h2 { font: 700 18px/1.4 var(--serif); margin: 6px 0; }
.study-card .by { color: var(--muted); font-size: 13.5px; }
.study-card p { color: var(--ink-2); font-size: 14px; margin: 10px 0 0; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(15, 12, 36, .86); z-index: 100; display: none; align-items: flex-start; justify-content: center; overflow: auto; padding: 30px 16px; }
.lightbox.on { display: flex; }
.lightbox .lb-in { background: #fff; border-radius: 10px; padding: 12px; max-width: min(1300px, 96vw); }
.lightbox img { display: block; max-width: 100%; margin: 0 auto 8px; }
.lightbox .lb-cap { font-size: 13.5px; color: var(--ink-2); padding: 4px 4px 0; }
.lightbox .lb-x { position: fixed; top: 12px; right: 16px; border: 0; background: rgba(255, 255, 255, .15); color: #fff; font-size: 22px; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; }

@media (max-width: 1000px) {
  .hero-in { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr; }
  .browser { grid-template-columns: 1fr; }
  .tree { display: none; }
  .tree-select { display: block; margin-bottom: 12px; }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .topbar-in { padding: 0 14px; gap: 10px; }
  .topnav { flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .lang { margin-left: 0; }
  .lang button { padding: 4px 9px; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { padding: 6px 7px; font-size: 13.5px; }
  .topnav a.ext { display: none; }
  .brand span { display: none; }
  .wrap, .hero-in { padding-left: 16px; padding-right: 16px; }
  .hero h1 { font-size: 26px; }
  .hero .subtitle { font-size: 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .detail { padding: 16px 14px 20px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .claim { grid-template-columns: 1fr; gap: 2px; }
  table.rt .hide-sm { display: none; }
  .cat-list { grid-template-columns: 1fr; }
}


/* ---------- additions for the renderer (study.js 1.0) ---------- */
.boot { padding: 80px 20px; text-align: center; color: var(--muted); }
.hero .byline b { font-weight: 700; }
.card.pad { padding: 18px 20px; }
.prose-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; align-items: start; }
.prose-grid .prose { max-width: none; }
.aside { padding: 14px 16px; }
.aside h4 { margin: 0 0 8px; font-size: 14px; color: var(--ink-2); }
.aside .kv { grid-template-columns: 96px minmax(0, 1fr); gap: 4px 10px; }
.aside .kv dt { font-size: 12.5px; }
.aside .kv dd { font-size: 13px; }
blockquote.quote { margin: 0 0 18px; padding: 12px 18px; border-left: 4px solid var(--gold); background: #fffaf0; border-radius: 0 10px 10px 0; font: 500 16px/1.7 var(--serif); color: var(--ink); max-width: 980px; }
.method .figcap { margin: -4px 0 10px; }
.method > .small { color: var(--ink-2); }
.kv.card { padding: 18px 20px; }
.kv dd > div { margin: 0 0 6px; }
.kv dd > div:last-child { margin-bottom: 0; }
.cite-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }   /* long URLs must not widen the page on phones */
.cite-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pubs { margin-top: 22px; }
.pubs h3 { font-size: 16px; margin: 0 0 8px; }
.pubs ol { margin: 0; padding-left: 22px; }
.pubs li { margin: 6px 0; }
code { font: 12.5px var(--mono); background: var(--line-2); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }

/* case detail */
.summary-wrap { margin-top: 12px; }
.summary { position: relative; max-height: 7.2em; overflow: hidden; color: var(--ink-2); }
.summary p { margin: 0 0 8px; }
.summary::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.4em; background: linear-gradient(rgba(255, 255, 255, 0), #fff); }
.summary.open { max-height: none; }
.summary.open::after { display: none; }
.ctl-select { font: inherit; font-size: 13px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; max-width: 100%; }
.view { min-height: 120px; }
.panels { display: flex; flex-direction: column; gap: 6px; }
.panel { border: 1px solid transparent; border-radius: 10px; padding: 4px 6px 2px; }
.panel.hl { border-color: #f1d98b; background: #fffdf5; }
.panel.playing { border-color: #c7bff3; background: #faf9ff; }
.panel-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 13.5px; }
.panel-head b { font-weight: 700; }
.panel-head .cap { color: var(--muted); font-size: 12.5px; margin-left: auto; }
.panel-head .dot, table.rt .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
button.play, .mini-play { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--brand); font-size: 10px; cursor: pointer; padding: 0 0 0 2px; line-height: 1; }
button.play:hover, .mini-play:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.legend .leg-item { display: inline-flex; align-items: center; gap: 4px; }
.legend button.static { cursor: default; }
.legend-note { margin: 10px 0 0; }
.chart svg text { font-family: var(--sans); }
.tempo-svg .grid line, .ioi-svg .grid line, .ov-svg .grid line { stroke: #e7e5ef; stroke-width: 1; }
.tempo-svg .grid line.v, .ov-svg .grid line.v { stroke: #e1dfeb; }
.tempo-svg .grid line.minor, .ioi-svg .grid line.minor { stroke: #f1f0f6; }
.ioi-svg .grid line.zero, .tempo-svg .grid line.zero { stroke: #3b3f4f; stroke-width: 1.2; }
.tempo-svg .grid .frame { fill: none; stroke: #cfcbe0; }
.chart .ax { font-size: 10.5px; fill: #737890; }
.chart .ax-title { font-size: 11.5px; fill: #4a4f60; }
.tempo-svg .band { fill: #bdbdc4; fill-opacity: .55; }
.tempo-svg .mean { stroke: #6b7183; stroke-width: 1; stroke-dasharray: 5 4; }
.tempo-svg .raw { stroke: #e0332e; stroke-width: 3.2; stroke-linecap: round; opacity: .8; fill: none; }
.tempo-svg .raw.big { stroke-width: 4.2; }
.tempo-svg .rawline { stroke: #e0332e; stroke-width: .8; fill: none; opacity: .5; }
.tempo-svg .curve { stroke: #111; stroke-width: 1.9; fill: none; stroke-linejoin: round; }
.tempo-svg .claim-band, .ioi-svg .claim-band { fill: #ffe9a6; fill-opacity: .6; }
.chart .playhead { stroke: var(--accent); stroke-width: 2; }
.chart .hover { stroke: #8a86a8; stroke-width: 1; stroke-dasharray: 2 3; }
.chart .hit { fill: transparent; cursor: crosshair; }
.overlay-svg .ov-line { fill: none; stroke-width: 1.8; stroke-linejoin: round; opacity: .92; transition: opacity .15s; }
.overlay-svg .ov-line.dim { opacity: .14; }
.overlay-svg .ov-line.focus { stroke-width: 3; opacity: 1; }
.overlay-svg .ov-dot { stroke: #fff; stroke-width: 2; }
.tempo-svg .pat-line { fill: none; stroke-width: 2; }
.chart .pt { cursor: pointer; }
.ioi-svg .ioi-line { fill: none; stroke-width: 1.5; stroke-linejoin: round; }
.ioi-svg .pt.out { fill: #fff !important; stroke: #c2410c; stroke-width: 1.6; }
.ioi-svg .out-label { font-size: 10.5px; fill: #c2410c; font-weight: 700; }
.chart .row-cap { font-size: 12px; fill: #1f2230; font-weight: 650; }
.ov-svg .ref { stroke: #6b7183; stroke-dasharray: 5 4; }
.ov-svg .trend { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 7 4; }
.ov-svg .pt:focus { outline: none; stroke: #111; }
.table-wrap { overflow-x: auto; }
table.rt.recs td { font-size: 13px; }
.media-row { padding: 4px 0; border-bottom: 1px dashed var(--line-2); }
.media-row:last-child { border-bottom: 0; }
.media-row .linkrow { margin: 2px 0 0 30px; }
.media-row .ann { font-size: 12.5px; color: var(--ink-2); white-space: normal; }
.credit { white-space: normal; }
details.async-data { margin: 8px 0; font-size: 13px; }
details.async-data summary { cursor: pointer; color: var(--brand-2); font-weight: 600; }
.pattern-table { margin-top: 8px; max-width: 760px; }
.chart-tip { position: fixed; z-index: 90; pointer-events: none; background: rgba(28, 25, 52, .94); color: #fff; font-size: 12px; line-height: 1.5; padding: 6px 9px; border-radius: 7px; display: none; max-width: 320px; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); }
.chart-tip .muted { color: #c9c5e6; }
/* floating audio player */
.player { position: fixed; left: 50%; bottom: 14px; transform: translate(-50%, 140%); z-index: 60; display: flex; align-items: center; gap: 10px; background: #1c1934; color: #fff; border-radius: 14px; padding: 8px 10px 8px 8px; width: min(620px, calc(100vw - 24px)); box-shadow: 0 12px 34px rgba(0, 0, 0, .3); transition: transform .2s ease; }
.player.on { transform: translate(-50%, 0); }
.player.err .pl-name { color: #fecaca; }
.pl-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: #f3d77a; color: #2a1d82; font-size: 13px; cursor: pointer; flex: none; }
.pl-mid { flex: 1; min-width: 0; }
.pl-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-name span { color: #c9c5e6; }
.pl-prog { height: 6px; background: rgba(255, 255, 255, .18); border-radius: 3px; margin-top: 6px; cursor: pointer; }
.pl-prog i { display: block; height: 100%; width: 0; background: #f3d77a; border-radius: 3px; }
.pl-time { font: 12px var(--mono); color: #d9d3fa; white-space: nowrap; }
.pl-x { border: 0; background: transparent; color: #c9c5e6; font-size: 20px; cursor: pointer; padding: 0 4px; }
/* catalogue extras */
.study-card .meta-line { display: flex; gap: 6px; align-items: center; }
.mini-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
@media (max-width: 1000px) {
  .prose-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { white-space: nowrap; flex: none; }
  .controls .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .controls .seg button { white-space: nowrap; flex: none; }
  .panel-head .cap { margin-left: 0; width: 100%; }
  .media-row .linkrow { margin-left: 0; }
  .pl-time { display: none; }
  blockquote.quote { font-size: 15px; }
}
@media print {
  .topbar, .player, .tree, .tree-select, .controls, .lang { display: none !important; }
  .browser { grid-template-columns: 1fr; }
  .hero { background: #fff; color: #000; }
}

/* English pages: Latin fonts first (CJK fonts render ’ “ ” full-width) */
html:lang(en) { --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Liberation Sans", "DejaVu Sans", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --serif: Georgia, "Times New Roman", "Liberation Serif", "DejaVu Serif", "Noto Serif CJK SC", "Songti SC", SimSun, serif; }

/* 1.0.1: second byline line, aside figure (book cover), uniform timeline thumbnails */
.hero .byline-2 { margin-top: 6px; font-size: 14px; color: #cfc8f5; }
.aside-figure { margin: 0 0 12px; display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: center; }
.aside-figure img { width: 92px; border-radius: 4px; box-shadow: 0 2px 8px rgba(20, 16, 60, .25); cursor: zoom-in; }
.aside-figure figcaption { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.tl-item .shots img { width: auto; max-width: 100%; height: 160px; object-fit: cover; }

/* 1.1.0: a recording highlighted by a link from the V3 library (#case=…&rec=<recording key>) */
.focus-note { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; padding: 7px 8px 7px 12px; border-radius: 10px; background: #fff8e1; border: 1px solid #f1d98b; font-size: 13px; color: var(--ink-2); }
.focus-note span { flex: 1; }
.focus-clear { border: none; background: transparent; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.focus-clear:hover { color: var(--ink); background: #fbeec4; }
.panel.rec-focus { border-color: #e0b84a; background: #fffbea; box-shadow: 0 0 0 3px rgba(241, 217, 139, .45); }
table.rt tr.rec-focus td { background: #fffbea; }
.leg-item.rec-focus > button { font-weight: 700; box-shadow: inset 0 -2px 0 #e0b84a; }
.ioi-svg .focus-row { fill: #fff3c4; fill-opacity: .75; }
.chart .row-cap.focus { fill: #7a4b00; }
.ioi-svg .ioi-line.focus { stroke-width: 3; }

/* 1.1.0: catalogue with many studies — count, search / type / sort bar, keywords */
.cat-hero .cat-count { margin-top: 10px; color: #cfc8f5; font-size: 14px; }
.cat-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-top: 22px; }
.cat-tools .cat-search { flex: 1 1 260px; min-width: 200px; max-width: 420px; font: inherit; font-size: 14px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); }
.cat-tools .cat-search:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand-2); }
.cat-tools .cat-shown { margin-left: auto; }
.cat-tools + .cat-list { padding-top: 16px; }
.study-card .kw { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 10px; }
.study-card .kw span { font-size: 12px; color: var(--brand-2); background: var(--brand-soft); border-radius: 999px; padding: 1px 8px; }

/* 1.2.0: score structure / tempo terms, per-version mean lines, zoomable score strips, "Tempo & MAD" tables */
.marks-strip { margin: 2px 0 -4px; }
.chart .mark-line { stroke: #3b3f4f; stroke-width: 1.2; }
.chart .mark-line.dash { stroke-dasharray: 5 4; stroke-width: 1; stroke: #6b7183; }
.chart .mark-line.term { stroke: #a39fc0; stroke-width: 1; stroke-dasharray: 2 3; }
.chart .mark-label { font-size: 11.5px; fill: #1f2230; font-weight: 700; }
.chart .mark-label.term { font-weight: 500; font-style: italic; fill: #4a4f60; }
.chart .mark-label.dash { font-weight: 500; fill: #6b7183; }
.overlay-svg .ov-mean { stroke-width: 1.2; stroke-dasharray: 5 4; opacity: .85; }
.overlay-svg .ov-mean.dim { opacity: .15; }
.overlay-svg .ov-mean-val { font-size: 10.5px; font-weight: 700; }
.overlay-svg .ov-mean-val.dim { opacity: .25; }
.ioi-chart.zoom { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.ioi-chart.zoom svg { max-width: none; height: auto; }
.ioi-svg .claim-row { fill: #fff8e1; }
.ioi-svg .ioi-line.dim, .ioi-svg .pt.dim { opacity: .15; }
.legend .leg-item.claim-on > button { box-shadow: inset 0 -2px 0 #e0b84a; font-weight: 650; }
.sec-charts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px 22px; margin: 4px 0 8px; }
.sec-charts.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sec-chart .panel-cap { margin: 0 0 4px; }
.sec-svg .sec-line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.sec-svg .sec-rec { cursor: pointer; transition: opacity .12s; }
.sec-svg .sec-rec.dim { opacity: .16; }
.sec-svg .sec-rec.on .sec-line { stroke-width: 3.4; }
.sec-svg .sec-rec.extra .sec-line { stroke-dasharray: 4 3; }
.sec-svg .sec-mean { fill: none; stroke: #1f2230; stroke-width: 2.4; stroke-dasharray: 7 4; }
.sec-svg .sec-mean-pt { fill: #1f2230; }
.sec-svg .sec-mark-band { fill: #e9f5e9; }
.sec-svg .sec-mark-line { stroke: #15803d; stroke-width: 1.2; stroke-dasharray: 6 4; }
.sec-svg .sec-mark-label { font-size: 11px; fill: #15803d; font-weight: 650; }
.sec-svg .ax.sec-col { font-size: 12px; fill: #1f2230; font-weight: 650; }
.sec-svg .pt-label { font-size: 11.5px; fill: #1f2230; }
table.sec-table th.grp { text-align: center; border-bottom: 1px solid var(--line-2); color: var(--ink); font-size: 12.5px; }
table.sec-table th.grp .sub { font-weight: 500; color: var(--muted); font-size: 11.5px; }
table.sec-table th.num { text-align: right; }
/* databars: background-image only (row highlights set background-color); .rt.sec-table outranks table.rt tr.rec-focus td */
table.rt.sec-table td.databar { background-image: linear-gradient(90deg, rgba(61, 43, 158, .42) var(--w), rgba(61, 43, 158, .07) var(--w)); background-repeat: no-repeat; background-size: calc(100% - 16px) 3px; background-position: 8px 30px; text-align: right; }
table.rt.sec-table td.databar.m { background-image: linear-gradient(90deg, rgba(194, 65, 12, .45) var(--w), rgba(194, 65, 12, .08) var(--w)); }
table.sec-table td.num { text-align: right; }
table.sec-table td.neg { color: #b42318; }
table.sec-table tr.hl-row td { background-color: #f4f1ff; }
table.sec-table tr.claim-on td { background-color: #fff8e1; }
table.sec-table tr.extra td { color: var(--muted); }
table.sec-table tfoot td { border-top: 2px solid var(--line); font-weight: 700; }
table.sec-table .tag { margin-left: 6px; }
@media (max-width: 860px) { .sec-charts.two { grid-template-columns: minmax(0, 1fr); } }
.sec-svg .sec-mark-label, .chart .mark-label { paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
table.sec-table td.who { min-width: 7.5em; }
table.sec-table td.who b { white-space: nowrap; }
table.sec-table td.who .who-name { white-space: nowrap; }
table.sec-table td.who .acc { margin-left: 16px; }
.method img { width: auto; max-width: 100%; max-height: 380px; align-self: flex-start; }
/* 1.2.0: the case detail must not grow with wide content (tables, zoomed score strips) on narrow screens */
.detail { min-width: 0; }
@media (max-width: 1000px) { .browser { grid-template-columns: minmax(0, 1fr); } }
/* ---------- 1.3.0: groups of recordings, beat ratios, beat patterns ---------- */
.legend.legend-groups { display: block; }
.legend .leg-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 2px 0 6px; }
.legend button.leg-act { padding: 2px 10px; font-size: 12.5px; color: var(--brand-2); }
.legend .leg-count { margin-left: 4px; }
.legend .leg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; padding: 5px 0; border-top: 1px solid var(--line-2); }
.legend button.leg-group { font-weight: 700; background: var(--line-2); border-color: transparent; }
.legend button.leg-group i { width: 11px; height: 11px; border-radius: 3px; }
.legend button.leg-group.part { opacity: .75; }
.legend button.leg-group.off { opacity: .45; }
.ov-panel-title { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--ink); margin: 10px 0 2px; }
.ov-panel-title i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.ov-panels .empty { padding: 30px 0; }
.tag.grp { background: #fff; border: 1px solid; font-weight: 600; margin-left: 4px; }
/* beat ratios */
.ratio-svg .r-zone { fill: #ffe4e6; fill-opacity: .75; }
.ratio-svg .r-zone-label { font-size: 12px; font-weight: 750; fill: #be123c; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.ratio-svg .r-diag { stroke: #8a86a8; stroke-width: 1; stroke-dasharray: 5 4; }
.ratio-svg .r-diag-label { font-size: 10.5px; fill: #737890; }
.ratio-svg .r-unit { stroke: #a39fc0; stroke-width: 1; }
.ratio-svg .r-pt { cursor: pointer; transition: opacity .12s; }
.ratio-svg .r-pt .pt { stroke: #fff; stroke-width: 1.2; }
.ratio-svg .r-pt.dim { opacity: .18; }
.ratio-svg .r-pt.on .pt { stroke: #1f2230; stroke-width: 1.6; }
.ratio-svg .pt-label { font-size: 11.5px; fill: #1f2230; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.ratio-svg .r-mean { stroke-width: 1.5; stroke: #fff; }
.ratio-svg .r-mean-paper { stroke-width: 1.6; stroke-dasharray: 3 2; }
.ratio-svg .r-mean-label { font-size: 12px; font-weight: 800; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
table.ratio-table { margin-top: 10px; }
table.ratio-table td { padding: 5px 8px; vertical-align: middle; }
table.ratio-table td.num { text-align: right; }
table.ratio-table th.num { text-align: right; }
table.ratio-table tr[data-rec] { cursor: pointer; }
table.ratio-table tr.grp-row td { background: var(--line-2); font-size: 13px; padding: 6px 8px; }
table.ratio-table tr.grp-row .dot { border-radius: 3px; }
table.ratio-table tr.mean-row td { border-bottom: 2px solid var(--line); }
table.ratio-table tr.hl-row td { background-color: #f4f1ff; }
table.ratio-table tr.claim-on td { background-color: #fff8e1; }
table.ratio-table tr.extra td { color: var(--muted); }
table.ratio-table td.who { white-space: nowrap; }
table.ratio-table td.r-type-v { color: #be123c; font-weight: 700; }
table.ratio-table td.r-type { white-space: nowrap; }
table.ratio-table td.rbar-td { width: 38%; min-width: 120px; }
.rbar { display: flex; height: 12px; border-radius: 3px; overflow: hidden; }
.rbar i { display: block; height: 100%; }
.rbar i.b1 { background: #cbd5e1; }
.rbar i.b2 { box-shadow: inset -1px 0 0 #fff; }
.rbar i.b3 { opacity: .55; }
.rbar .rest { display: block; }
/* beat patterns */
.pattern-svg .p-lab { font-size: 11.5px; font-weight: 700; fill: #1f2230; }
.pattern-svg .p-lab.muted { font-weight: 500; fill: #737890; font-size: 10.5px; }
.pattern-svg .p-share-val { font-size: 9.5px; fill: #4a4f60; font-variant-numeric: tabular-nums; }
.pattern-svg .p-base { stroke: #cfcbe0; }
.pattern-svg .p-grp { font-size: 12px; font-weight: 750; fill: #1f2230; }
.pattern-svg .p-rec { font-size: 11px; fill: #1f2230; }
.pattern-svg .p-cnt { font-size: 10.5px; fill: #737890; font-variant-numeric: tabular-nums; }
.pattern-svg .p-cnt.hi { fill: #be123c; font-weight: 700; }
.pattern-svg .p-cell { cursor: pointer; }
.pattern-svg .p-cell:hover { stroke: #1f2230; stroke-width: 1.2; }
.pattern-svg .p-row.dim { opacity: .25; }
.pattern-svg .claim-band { fill: #ffe9a6; fill-opacity: .55; }
.pattern-svg .claim-row { fill: #fff8e1; }
.pattern-svg .focus-row { fill: #fff3c4; }
.p-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 4px; color: var(--ink-2); }
.p-legend span { display: inline-flex; align-items: center; gap: 5px; }
.p-legend i { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.p-dist-ctl { margin-top: 18px; }
.p-dist-row { margin: 8px 0 12px; }
.p-dist-lab { font-size: 13px; margin-bottom: 3px; }
.p-dist-lab .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.p-stack { display: flex; height: 20px; border-radius: 4px; overflow: hidden; background: var(--line-2); }
.p-stack span { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #1f2230; white-space: nowrap; overflow: hidden; }
.p-stack span.v { color: #fff; }
.p-paper { color: var(--brand-2); margin-top: 2px; }
@media (max-width: 720px) {
  table.ratio-table td.rbar-td { width: 30%; min-width: 70px; }
  .legend .leg-row { gap: 4px 6px; }
}
