/* Neutral surfaces and semantic accents adapted from GitHub's official Primer
   primitives (light/default dark), not a GitHub component or layout dependency.
   Source mapping and deployment notes: docs/theme-and-deployment.md.
   Blue = links/focus/selection; green = primary actions/success/activity only. */
:root {
  color-scheme: light;
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-subtle: #f6f8fa;
  --surface-hover: #eff2f5;
  --chrome-bg: #f6f8fa;
  --input-bg: #ffffff;
  --ink: #1f2328;
  --text-secondary: #454c54;
  --muted: #59636e;
  --line: #d1d9e0;
  --line-strong: #818b98;
  --action-bg: #1f883d;
  --action-hover: #1a7f37;
  --on-action: #ffffff;
  --accent-fg: #0969da;
  --accent-subtle: #ddf4ff;
  --selection-bg: #eff2f5;
  --success-fg: #1a7f37;
  --danger-fg: #cf222e;
  --danger-bg: #ffebe9;
  --warning-fg: #7d4e00;
  --warning-bg: #fff8c5;
  --logo-bg: #1f2328;
  --logo-fg: #ffffff;
  --focus: #0969da;
  --shadow-sm: 0 1px 0 #1f23280a;
  --shadow-dialog: 0 8px 24px #1f232833;
  --backdrop: #1f232866;
  --sidebar: 240px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --heat-0: #eff2f5;
  --heat-1: #aceebb;
  --heat-2: #4ac26b;
  --heat-3: #2da44e;
  --heat-4: #116329;
  font-family: 'Inter', 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', system-ui, sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--bg);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1117;
  --surface: #151b23;
  --surface-raised: #212830;
  --surface-subtle: #212830;
  --surface-hover: #262c36;
  --chrome-bg: #151b23;
  --input-bg: #0d1117;
  --ink: #f0f6fc;
  --text-secondary: #b7bdc8;
  --muted: #9198a1;
  --line: #3d444d;
  --line-strong: #656c76;
  --action-bg: #238636;
  --action-hover: #1f883d;
  --on-action: #ffffff;
  --accent-fg: #58a6ff;
  --accent-subtle: #388bfd1a;
  --selection-bg: #212830;
  --success-fg: #3fb950;
  --danger-fg: #ff7b72;
  --danger-bg: #f851491a;
  --warning-fg: #f2cc60;
  --warning-bg: #9e6a0326;
  --logo-bg: #f0f6fc;
  --logo-fg: #0d1117;
  --focus: #58a6ff;
  --shadow-sm: 0 1px 0 #01040966;
  --shadow-dialog: 0 8px 24px #01040999;
  --backdrop: #010409b3;
  --heat-0: #212830;
  --heat-1: #033a16;
  --heat-2: #196c2e;
  --heat-3: #2ea043;
  --heat-4: #56d364;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; background: none; color: inherit; cursor: pointer; }
button { transition: background 150ms, box-shadow 150ms, border-color 150ms; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 3px;
}
h1, h2, h3, p { margin: 0; }
svg { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; flex-direction: column; width: var(--sidebar); padding: 32px 20px 24px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; white-space: nowrap; font-size: 24px; font-weight: 700; letter-spacing: -1px; }
.brand-dot { color: var(--muted); }
.brand-mark { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: var(--logo-bg); color: var(--logo-fg); }
.brand-mark svg { width: 24px; height: 24px; }
.workspace { display: flex; align-items: center; gap: 8px; margin: 32px 4px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-subtle); color: var(--text-secondary); font-size: 12px; }
.workspace i, .status-dot { display: inline-block; flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--success-fg); }
.workspace span { margin-left: auto; font-size: 10px; letter-spacing: 1px; color: var(--muted); }
.nav-label { margin: 0 12px 12px; color: var(--muted); font-size: 12px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; margin-bottom: 4px; padding: 12px; border-radius: var(--radius-sm); text-align: left; font-size: 14px; color: var(--text-secondary); }
.nav-item svg { color: var(--muted); }
.nav-item.active { background: var(--selection-bg); color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 var(--focus); }
.nav-item.active svg { color: var(--accent-fg); }
.nav-item:hover { background: var(--surface-hover); }
.nav-item.active:hover { background: var(--selection-bg); }
.nav-item em { margin-left: auto; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-style: normal; background: var(--surface); }
.sidebar-rule { height: 1px; flex-shrink: 0; background: var(--line); margin: 24px 12px; }
.sidebar-bottom { margin-top: auto; padding-top: 24px; }
.side-footer { display: flex; justify-content: space-between; padding: 24px 4px 0; font-size: 10px; color: var(--muted); }
.shell { margin-left: var(--sidebar); }
.topbar { min-height: 76px; padding: 16px 40px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--chrome-bg); border-bottom: 1px solid var(--line); }
.breadcrumb { color: var(--muted); font-size: 12px; white-space: nowrap; }
.breadcrumb span { margin-left: 12px; }
.breadcrumb span:last-child { color: var(--ink); font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 16px; }
.guide-link { min-height: 44px; font-size: 12px; color: var(--text-secondary); padding: 8px; }
.primary, .secondary { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; line-height: 1.4; }
.primary { background: var(--action-bg); color: var(--on-action); box-shadow: var(--shadow-sm); }
.primary:hover { background: var(--action-hover); }
.secondary { border: 1px solid var(--line-strong); background: var(--surface); }
.secondary:hover { background: var(--surface-hover); }
.primary svg, .secondary svg { width: 16px; height: 16px; }
.theme-control { position: relative; display: flex; align-items: center; color: var(--text-secondary); border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); }
.theme-control > svg { width: 16px; height: 16px; position: absolute; left: 12px; pointer-events: none; color: var(--muted); }
.theme-control select { min-height: 44px; width: 136px; padding: 8px 8px 8px 36px; font-size: 12px; color: var(--ink); background: transparent; border: 0; border-radius: var(--radius-sm); cursor: pointer; }
select option { background: var(--surface-raised); color: var(--ink); }
.main { max-width: 1480px; margin: auto; padding: 24px 32px 48px; }
.page-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 20px; }
.page-heading h1 { font-size: 24px; font-weight: 600; line-height: 1.4; }
.page-heading > span { font-size: 12px; color: var(--muted); }
.stat-divider { margin-inline: 8px; }
.mobile-nav { display: none; }
.eyebrow { display: block; font-size: 12px; font-weight: 600; color: var(--accent-fg); }
/* Daily activity comes from the same persisted uploads as the update list. */
.activity-panel { min-width: 0; padding: 16px 20px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.activity-header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 16px; }
.activity-header h2 { font-size: 14px; font-weight: 600; }
.demo-badge { padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.activity-range { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.heatmap-scroll { max-width: 100%; overflow-x: auto; padding: 4px 4px 8px; scrollbar-width: thin; }
.heatmap-layout { --cell: 10px; --gap: 3px; display: grid; grid-template-columns: 20px max-content; grid-template-rows: 20px max-content; gap: 4px 8px; width: max-content; min-width: 100%; }
.heatmap-months { grid-column: 2; display: grid; grid-template-columns: repeat(var(--weeks), var(--cell)); gap: var(--gap); color: var(--muted); font-size: 10px; }
.heatmap-months > span { white-space: nowrap; }
.heatmap-weekdays { grid-row: 2; display: grid; grid-template-rows: repeat(7, var(--cell)); gap: var(--gap); color: var(--muted); font-size: 10px; line-height: var(--cell); }
.heatmap-weekdays span:nth-child(1) { grid-row: 2; }
.heatmap-weekdays span:nth-child(2) { grid-row: 4; }
.heatmap-weekdays span:nth-child(3) { grid-row: 6; }
.heatmap-days { grid-column: 2; grid-row: 2; display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, var(--cell)); grid-template-columns: repeat(var(--weeks), var(--cell)); gap: var(--gap); }
.heatmap-day, .heatmap-padding, .heatmap-legend i { display: block; width: var(--cell, 10px); height: var(--cell, 10px); border-radius: 2px; padding: 0; }
[data-level="0"] { background: var(--heat-0); }
[data-level="1"] { background: var(--heat-1); }
[data-level="2"] { background: var(--heat-2); }
[data-level="3"] { background: var(--heat-3); }
[data-level="4"] { background: var(--heat-4); }
.heatmap-day { box-shadow: inset 0 0 0 1px var(--line); }
.heatmap-day[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 1px; }
.heatmap-day:focus-visible { outline-width: 2px; outline-offset: 1px; }
.activity-summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin: 8px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.activity-summary strong { color: var(--text-secondary); font-weight: 600; }
.heatmap-legend { display: flex; align-items: center; gap: 4px; font-size: 10px; }
.heatmap-legend span:first-child { margin-right: 4px; }
.heatmap-legend span:last-child { margin-left: 4px; }
#activity-details { margin: 0 -20px; border-top: 1px solid var(--line); padding: 8px 20px 12px; }
.updates-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; }
.updates-heading h3 { font-size: 12px; font-weight: 600; }
.updates-heading > span { color: var(--muted); font-size: 10px; }
.inline-button { min-height: 28px; padding: 4px; color: var(--accent-fg); font-size: 12px; }
.updates-list { list-style: none; margin: 4px 0 0; padding: 0; }
.updates-list li { display: flex; align-items: baseline; gap: 8px; min-height: 28px; font-size: 12px; line-height: 1.8; }
.update-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex-shrink: 0; align-self: center; }
.update-author { min-width: 32px; color: var(--ink); }
.update-description { color: var(--muted); }
.update-description button { padding: 2px 0; text-align: left; color: var(--accent-fg); font-weight: 600; }
.update-description button:hover { text-decoration: underline; text-underline-offset: 3px; }
.updates-list time { margin-left: auto; flex-shrink: 0; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.activity-empty { padding: 12px 0 4px; color: var(--muted); font-size: 12px; }
.section-heading { display: flex; align-items: center; gap: 12px; margin: 32px 0 20px; }
.section-heading h2 { font-size: 20px; font-weight: 600; letter-spacing: -.5px; }
.count-badge { border-radius: 6px; padding: 4px 8px; font-size: 12px; color: var(--text-secondary); background: var(--surface-subtle); }
.section-heading .subtle { margin-left: auto; color: var(--muted); font-size: 12px; }
.toolbar { display: flex; align-items: center; gap: 24px; margin-bottom: 16px; }
.search { position: relative; flex: 1; max-width: 520px; }
.search > svg { position: absolute; left: 16px; top: 14px; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; height: 48px; padding: 12px 48px; border: 1px solid var(--line-strong); background: var(--input-bg); border-radius: var(--radius-sm); font-size: 14px; color: var(--ink); box-shadow: var(--shadow-sm); }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.keycap { position: absolute; top: 12px; right: 12px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; font-size: 12px; color: var(--muted); }
.sort { display: flex; align-items: center; gap: 8px; margin-left: auto; white-space: nowrap; font-size: 12px; color: var(--muted); }
.sort select { max-width: 128px; min-height: 44px; padding: 8px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); font-size: 12px; cursor: pointer; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.filter { min-height: 40px; padding: 8px 12px; font-size: 14px; color: var(--text-secondary); border-radius: var(--radius-sm); }
.filter.active { background: var(--selection-bg); color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--focus); }
.filter:not(.active):hover { background: var(--surface-subtle); }
.filter span { margin-left: 8px; color: var(--muted); font-size: 12px; }
.filter.active span { color: var(--text-secondary); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.skill-card { min-width: 0; display: flex; flex-direction: column; padding: 16px 20px 0; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); transition: border-color 150ms; }
.skill-card:hover { border-color: var(--line-strong); }
.card-top { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.skill-icon { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 6px; color: var(--text-secondary); background: var(--surface-subtle); }
.skill-icon svg { width: 20px; height: 20px; }
.category-label { margin-left: auto; padding: 2px 6px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 12px; font-size: 12px; color: var(--text-secondary); }
.card-title { min-height: 32px; padding: 0; text-align: left; color: var(--accent-fg); font-size: 14px; font-weight: 600; line-height: 1.5; }
.card-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.skill-id { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font: 12px/1.8 ui-monospace, 'Cascadia Code', monospace; overflow-wrap: anywhere; }
.skill-id span { margin-left: auto; }
.card-desc { min-height: 48px; margin: 12px 0; color: var(--text-secondary); font-size: 14px; line-height: 1.8; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tag { padding: 2px 6px; border-radius: 4px; color: var(--accent-fg); background: var(--accent-subtle); font-size: 12px; line-height: 1.7; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; padding-bottom: 12px; font-size: 12px; color: var(--muted); }
.card-meta time { margin-left: auto; font-size: 12px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 -20px; padding: 2px 12px; border-top: 1px solid var(--line); }
.download { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; padding: 8px; font-size: 12px; color: var(--accent-fg); font-weight: 600; border-radius: 6px; white-space: nowrap; }
.download:hover { background: var(--surface-hover); }
.download svg { width: 16px; height: 16px; }
.empty { padding: 64px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); text-align: center; }
.empty h3 { font-size: 20px; font-weight: 600; margin-bottom: 12px; }
.empty p { max-width: 35em; margin: auto; color: var(--text-secondary); font-size: 14px; line-height: 1.8; }
.empty button { margin-top: 24px; }
.bottom-note { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 32px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.bottom-note svg { width: 16px; height: 16px; }
/* Native dialog supplies focus trapping, Escape handling and top-layer placement. */
dialog { max-height: 88vh; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface-raised); color: var(--ink); box-shadow: var(--shadow-dialog); }
dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(4px); }
.close { position: absolute; z-index: 1; top: 12px; right: 12px; display: grid; place-items: center; width: 44px; height: 44px; color: var(--muted); font-size: 28px; line-height: 1; border-radius: var(--radius-sm); }
.close:hover { background: var(--surface-subtle); }
.guide-dialog { width: 560px; padding: 40px; }
.guide-dialog h2 { margin: 16px 0 12px; font-size: 28px; line-height: 1.4; font-weight: 600; letter-spacing: -.5px; }
.muted { color: var(--text-secondary); font-size: 14px; line-height: 1.8; }
.steps { list-style: none; margin: 32px 0; padding: 0; }
.steps li { display: flex; gap: 16px; margin-bottom: 24px; }
.steps li > span { display: grid; place-items: center; flex-shrink: 0; align-self: flex-start; width: 32px; height: 32px; color: var(--accent-fg); background: var(--accent-subtle); border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; }
.steps h3 { margin: 4px 0 8px; font-size: 14px; font-weight: 600; }
.steps p { font-size: 12px; line-height: 1.8; color: var(--text-secondary); }
.steps code { display: block; padding: 12px; margin: 12px 0; border-radius: var(--radius-sm); background: var(--surface-subtle); color: var(--ink); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.notice { padding: 16px; color: var(--text-secondary); background: var(--surface-subtle); border-left: 3px solid var(--line-strong); border-radius: var(--radius-sm); font-size: 12px; line-height: 1.8; }
.notice strong { color: var(--ink); }
.wide { width: 100%; margin-top: 24px; }
.detail-dialog { width: 880px; }
.detail-head { padding: 32px 40px 24px; background: var(--surface-subtle); border-bottom: 1px solid var(--line); }
.detail-heading { display: flex; align-items: center; gap: 16px; margin: 0 32px 16px 0; }
.detail-heading h2 { font-size: 24px; font-weight: 600; line-height: 1.4; margin-bottom: 8px; }
.detail-heading small { font-size: 12px; color: var(--muted); }
.detail-head > p { max-width: 40em; font-size: 14px; line-height: 1.8; color: var(--text-secondary); }
.detail-body { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 32px; padding: 32px 40px; }
.detail-content { min-width: 0; }
.detail-content h3 { margin-bottom: 12px; font-size: 16px; font-weight: 600; }
.detail-content p, .detail-content li { font-size: 14px; line-height: 1.8; color: var(--text-secondary); }
.detail-content ul { margin: 0 0 32px; padding-left: 20px; }
.detail-content li + li { margin-top: 8px; }
.prompt { padding: 16px; border-radius: var(--radius-sm); background: var(--accent-subtle); color: var(--accent-fg); font-size: 14px; line-height: 1.8; }
.copy { min-height: 44px; margin-top: 4px; padding: 8px 0; color: var(--accent-fg); font-size: 12px; font-weight: 600; }
.detail-content .section-gap { margin-top: 32px; }
.file-tree { padding: 16px; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: var(--radius-sm); background: var(--surface-subtle); color: var(--text-secondary); font: 12px/1.8 ui-monospace, 'Cascadia Code', monospace; }
.detail-content summary { min-height: 44px; padding: 12px 0; color: var(--accent-fg); font-size: 12px; font-weight: 600; cursor: pointer; }
.detail-aside { border-left: 1px solid var(--line); padding-left: 24px; }
.detail-aside .primary { width: 100%; font-size: 12px; }
.detail-aside dl { margin: 24px 0; font-size: 12px; }
.detail-aside dt { color: var(--muted); margin-top: 20px; }
.detail-aside dd { margin: 8px 0 0; color: var(--ink); line-height: 1.7; }
.text-button { width: 100%; min-height: 44px; padding: 12px 0; color: var(--accent-fg); text-align: center; font-size: 12px; }
.text-button:hover { text-decoration: underline; text-underline-offset: 4px; }
.share-preview { display: flex; flex-direction: column; gap: 12px; margin: 24px 0; padding: 32px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-subtle); color: var(--text-secondary); text-align: center; }
.folder-symbol { font-size: 24px; color: var(--text-secondary); }
.share-preview strong { font-size: 14px; font-weight: 600; color: var(--ink); }
.share-preview > span:last-child { font-size: 12px; line-height: 1.8; }
#toast { position: fixed; z-index: 60; bottom: 88px; left: 50%; max-width: calc(100vw - 32px); padding: 12px 24px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-raised); color: var(--ink); box-shadow: var(--shadow-dialog); text-align: center; font-size: 14px; line-height: 1.5; opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(8px); transition: opacity 150ms, transform 150ms; }
#toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
/* One resource-library layout: compact desktop cards, accessible mobile navigation. */
@media (min-width: 1536px) {
  .main { padding-inline: 40px; }
  .grid { gap: 20px; }
  .heatmap-layout { --cell: 12px; --gap: 4px; }
}
@media (max-width: 1199px) {
  :root { --sidebar: 216px; }
  .sidebar { padding-inline: 16px; }
  .brand { gap: 8px; font-size: 22px; padding-inline: 4px; }
  .main { padding-inline: 24px; }
  .topbar { padding-inline: 24px; }
  .top-actions { gap: 12px; }
  .guide-link { display: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 959px) {
  .top-actions { gap: 8px; }
  .breadcrumb span { margin-left: 8px; }
  .theme-control select { width: 124px; }
  .share-button { padding-inline: 12px; font-size: 12px; }
  .card-top { flex-wrap: wrap; }
  .category-label { margin-left: 0; }
  .activity-range { flex-basis: 100%; margin-left: 0; }
}
@media (max-width: 767px) {
  :root { --sidebar: 0px; }
  .sidebar { display: none; }
  .topbar { min-height: 64px; padding: 10px 24px; gap: 12px; }
  .main { padding: 20px 24px 40px; }
  .mobile-nav { display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); margin: -4px 0 20px; }
  .mobile-nav button { min-height: 44px; padding: 8px 4px; font-size: 12px; color: var(--text-secondary); }
  .mobile-nav button[aria-current="page"] { box-shadow: inset 0 -2px var(--focus); color: var(--ink); font-weight: 600; }
  .mobile-nav span { margin-left: 4px; }
  .card-top { flex-wrap: nowrap; }
  .category-label { margin-left: auto; }
  .detail-body { grid-template-columns: minmax(0, 1fr) 216px; padding: 24px; gap: 24px; }
  .detail-head { padding: 32px 24px 24px; }
}
@media (max-width: 539px) {
  .topbar { padding: 10px 16px; }
  .breadcrumb { font-weight: 600; color: var(--ink); font-size: 14px; }
  .breadcrumb span { display: none; }
  .share-button { width: 44px; padding: 12px; }
  .share-button span { display: none; }
  .theme-control select { width: 128px; }
  .main { padding: 20px 16px 40px; }
  .page-heading { gap: 8px 12px; margin-bottom: 16px; }
  .page-heading h1 { font-size: 20px; }
  .activity-panel { padding: 12px 12px 0; }
  .activity-header { gap: 8px; margin-bottom: 8px; }
  .activity-range { font-size: 10px; }
  .activity-summary { gap: 8px; }
  .heatmap-legend { margin-left: auto; }
  #activity-details { margin-inline: -12px; padding-inline: 12px; }
  .updates-list li { flex-wrap: wrap; gap: 0 8px; padding: 4px 0; }
  .updates-list time { margin-left: 14px; flex-basis: 100%; }
  .update-description { flex: 1; }
  .section-heading { margin: 24px 0 16px; }
  .section-heading h2 { font-size: 16px; }
  .toolbar { flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
  .search { flex-basis: 100%; max-width: none; }
  .search input { font-size: 14px; padding-right: 16px; }
  .keycap { display: none; }
  .sort { margin-left: 0; }
  .filters { gap: 4px; margin-bottom: 16px; }
  .filter { font-size: 12px; padding: 8px 10px; }
  .filter span { margin-left: 4px; font-size: 12px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .card-desc { min-height: 0; }
  .skill-card { padding: 16px 16px 0; }
  .card-footer { margin-inline: -16px; padding-inline: 8px; }
  .bottom-note { text-align: left; font-size: 12px; }
  .guide-dialog { width: calc(100% - 24px); padding: 32px 24px; }
  .guide-dialog h2 { font-size: 20px; padding-right: 8px; }
  .detail-dialog { width: calc(100% - 24px); }
  .detail-head { padding: 32px 24px 24px; }
  .detail-heading h2 { font-size: 20px; }
  .detail-heading { gap: 12px; }
  .detail-body { display: flex; flex-direction: column; gap: 32px; padding: 24px; }
  .detail-aside { border-left: 0; border-top: 1px solid var(--line); padding: 24px 0 0; }
  .detail-aside dl { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 12px; }
  .detail-aside dt, .detail-aside dd { margin: 0; line-height: 1.8; }
}
[hidden] { display: none !important; }
button:disabled { cursor: wait; opacity: .6; }
.load-error { margin-bottom: 20px; padding: 12px 16px; border: 1px solid var(--danger-fg); border-left-width: 4px; background: var(--danger-bg); border-radius: var(--radius-sm); color: var(--danger-fg); font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.detail-loading { padding: 64px 40px; min-width: 280px; font-size: 14px; }
.upload-dialog { width: min(880px, calc(100% - 32px)); padding: 32px; }
.upload-header { margin-right: 32px; margin-bottom: 24px; }
.upload-header h2 { margin-bottom: 8px; font-size: 24px; font-weight: 600; }
.upload-picker { display: flex; flex-wrap: wrap; gap: 12px; padding: 20px; border: 1px dashed var(--line-strong); background: var(--surface-subtle); border-radius: var(--radius); }
.upload-picker p { flex-basis: 100%; margin: 4px 0 0; color: var(--text-secondary); font-size: 12px; line-height: 1.8; }
.upload-status { margin: 16px 0; color: var(--text-secondary); font-size: 12px; line-height: 1.8; }
.upload-warnings { padding: 16px 16px 16px 32px; margin: 0 0 24px; border: 1px solid var(--warning-fg); border-radius: var(--radius-sm); background: var(--warning-bg); color: var(--warning-fg); font-size: 12px; line-height: 1.8; }
.upload-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 24px; }
.form-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin-bottom: 20px; font-size: 14px; font-weight: 600; }
.form-field > span { font-size: 12px; color: var(--muted); font-weight: 400; line-height: 1.7; }
.form-field input, .form-field select, .markdown-editor textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--input-bg); color: var(--ink); font-size: 14px; font-weight: 400; }
.markdown-editor { margin-bottom: 24px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.editor-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 16px; background: var(--surface-subtle); border-bottom: 1px solid var(--line); }
.editor-heading > label { font-size: 14px; font-weight: 600; }
.editor-heading label span { color: var(--muted); font-size: 12px; margin-left: 8px; font-weight: 400; }
.editor-tabs { display: flex; gap: 8px; }
.editor-tabs button { min-height: 36px; padding: 8px 12px; font-size: 12px; border-radius: var(--radius-sm); color: var(--text-secondary); }
.editor-tabs button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: inset 0 -2px var(--focus); font-weight: 600; }
.markdown-editor textarea { min-height: 240px; border: 0; border-radius: 0; resize: vertical; font: 14px/1.8 ui-monospace, 'Cascadia Code', 'Microsoft YaHei', monospace; }
.markdown-editor textarea:focus-visible { outline-offset: -3px; }
.field-hint { padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.8; }
#upload-preview { min-height: 240px; padding: 20px; background: var(--surface); }
.upload-files { margin: 16px 0; min-width: 0; }
.upload-files summary { min-height: 40px; padding: 10px 0; color: var(--text-secondary); font-size: 12px; cursor: pointer; }
.upload-files summary span { margin-left: 12px; color: var(--muted); }
#upload-file-list { padding: 0; margin: 8px 0 20px; list-style: none; max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
#upload-file-list li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--text-secondary); }
#upload-file-list code { overflow-wrap: anywhere; }
#upload-file-list span { white-space: nowrap; color: var(--muted); }
.upload-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.upload-footer > span { font-size: 12px; color: var(--muted); }
.markdown-body { min-width: 0; color: var(--text-secondary); font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 { margin: 24px 0 12px; color: var(--ink); font-size: 16px; font-weight: 600; line-height: 1.5; }
.markdown-body h1 { font-size: 24px; }
.markdown-body h2 { font-size: 20px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.markdown-body p, .markdown-body ul, .markdown-body ol, .markdown-body pre, .markdown-body blockquote, .markdown-body table { margin: 0 0 16px; }
.markdown-body ul, .markdown-body ol { padding-left: 24px; }
.markdown-body li + li { margin-top: 4px; }
.markdown-body a { color: var(--accent-fg); text-decoration: underline; text-underline-offset: 3px; }
.markdown-body pre { max-width: 100%; overflow-x: auto; padding: 16px; border-radius: var(--radius-sm); background: var(--surface-subtle); font: 12px/1.8 ui-monospace, 'Cascadia Code', monospace; }
.markdown-body :not(pre) > code { padding: 2px 4px; border-radius: 4px; background: var(--surface-subtle); font-size: .9em; }
.markdown-body pre code { white-space: pre; }
.markdown-body blockquote { padding: 4px 16px; border-left: 3px solid var(--line-strong); color: var(--muted); }
.markdown-body blockquote p:last-child { margin-bottom: 0; }
.markdown-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.markdown-body th, .markdown-body td { padding: 8px 12px; border: 1px solid var(--line); }
.markdown-body th { background: var(--surface-subtle); color: var(--ink); }
.markdown-body hr { margin: 24px 0; border: 0; border-top: 1px solid var(--line); }
@media (max-width: 539px) {
  .upload-dialog { width: calc(100% - 24px); padding: 24px 20px; }
  .upload-fields { grid-template-columns: minmax(0, 1fr); }
  .upload-picker { padding: 16px; }
  .upload-picker .secondary { width: 100%; }
  .upload-header h2 { font-size: 20px; }
  .upload-footer .primary { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
