/* xcshop: parchment / amber. Mode names in the UI remain light / dark. */
:root {
  color-scheme: light;
  --paper: #eadbc1;
  --ink: #3c3023;
  --muted: #75634d;
  --accent: #a66a23;
  --line: #3c30231a;
  --card: #3c302309;
  --card-hover: #3c302314;
  --card-pressed: #3c30231f;
  --icon-bg: #3c30231a;
  --sponsor: #7251ad;
  --sponsor-bg: #7251ad1a;
  --sponsor-hover: #7251ad2e;
  --sponsor-line: #7251ad7a;
  --cover-top: #eadbc180;
  --cover-tint: #eadbc11f;
  --rail-width: 160px;
  --page: 880px;
  --cover-height: max(280px, calc(100svh - 156px));
  --cover-pinned: calc(var(--cover-height) * 21 / 115);
  --profile-height: 156px;
  --scroll-offset: calc(var(--cover-pinned) + var(--profile-height) + 24px);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
}
:root[data-theme="amber"] {
  color-scheme: dark;
  --paper: #33251d;
  --ink: #fff9f3;
  --muted: #c4af9b;
  --accent: #df963b;
  --line: #fff9f31a;
  --card: #fff9f309;
  --card-hover: #fff9f314;
  --card-pressed: #fff9f31f;
  --icon-bg: #fff9f31a;
  --sponsor: #c2a4f2;
  --sponsor-bg: #c2a4f21a;
  --sponsor-hover: #c2a4f22e;
  --sponsor-line: #c2a4f27a;
  --cover-top: #33251da6;
  --cover-tint: #33251d35;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--scroll-offset); background: var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 13px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; cursor: pointer; border: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
::selection { color: var(--ink); background: var(--icon-bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 5px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: 12px; left: 12px; padding: 10px 16px; background: var(--paper); transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.floating-brand { position: fixed; z-index: 20; top: 18px; left: 32px; display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 650; background: transparent; }
.floating-brand img { width: 28px; height: 28px; padding: 4px; border-radius: 8px; background: #161310; object-fit: contain; }
.brand-domain { color: var(--muted); font-weight: 400; }
.side-rail { position: fixed; z-index: 15; left: 18px; top: 50%; transform: translateY(-50%); width: 142px; max-height: calc(100svh - 160px); padding: 5px 7px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.side-nav { display: flex; flex-direction: column; gap: 5px; }
.side-nav a { position: relative; display: flex; align-items: center; width: max-content; max-width: 100%; min-height: 42px; padding: 9px 0; border: 0; border-radius: 0; background: transparent; color: var(--muted); font-size: 12px; line-height: 1.7; text-align: left; opacity: .45; transition: color 160ms, opacity 160ms; }
.side-nav a::after { content: ""; position: absolute; left: 0; bottom: 6px; width: 100%; height: 1px; background: currentColor; opacity: .35; transform: scaleX(.2); transform-origin: left; transition: transform 180ms, opacity 180ms; }
.nav-label { display: grid; }
.nav-label > span { grid-area: 1 / 1; white-space: nowrap; transition: opacity 160ms, transform 180ms; }
.nav-full { opacity: 0; transform: translateX(-4px); }
.nav-short { opacity: 1; }
.side-rail:is(:hover, :focus-within) .side-nav a { opacity: .75; }
.side-rail .side-nav a:is(:hover, :focus-visible) { color: var(--ink); opacity: 1; }
.side-rail .side-nav a[aria-current="location"] { color: var(--accent); opacity: 1; }
.side-rail .side-nav a:is(:hover, :focus-visible, [aria-current="location"])::after { transform: scaleX(1); opacity: .8; }
.side-rail .side-nav a:is(:hover, :focus-visible, [aria-current="location"]) .nav-full { opacity: 1; transform: translateX(0); }
.side-rail .side-nav a:is(:hover, :focus-visible, [aria-current="location"]) .nav-short { opacity: 0; transform: translateX(4px); }
.side-rail .side-nav a[aria-current="location"]::after { height: 2px; opacity: 1; }
.theme-button { display: inline-flex; align-items: center; justify-content: center; gap: 0; min-height: 36px; max-width: 100%; margin-top: 23px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font-size: 12px; line-height: 1.5; white-space: nowrap; transition: background 140ms, border-color 140ms; }
.theme-button [data-theme-label] { display: block; max-width: 0; margin-left: 0; overflow: hidden; opacity: 0; transition: max-width 180ms, margin-left 180ms, opacity 140ms; }
.side-rail:is(:hover, :focus-within) .theme-button [data-theme-label] { max-width: 6em; margin-left: 7px; opacity: 1; }
.theme-button:hover { border-color: var(--icon-bg); background: var(--card-hover); }
.theme-button:active { background: var(--card-pressed); }
[data-theme-icon] { display: inline-grid; place-items: center; width: 16px; font-size: 17px; line-height: 1; }
.page-width { width: min(var(--page), calc(100% - 2 * (var(--rail-width) + 16px))); margin-inline: auto; }
.cover { position: sticky; top: calc(var(--cover-pinned) - var(--cover-height)); z-index: 3; height: var(--cover-height); overflow: hidden; background: var(--paper); }
.cover-image { width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center; transform: translateY(var(--cover-offset, 0px)); }
.cover-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, var(--cover-top), transparent 35%), linear-gradient(var(--cover-tint), var(--cover-tint)); }
.cover::after { content: ""; pointer-events: none; position: absolute; inset: auto 0 0; height: min(180px, 35%); background: linear-gradient(transparent, color-mix(in srgb, var(--paper) 32%, transparent) 45%, var(--paper)); }
.cover-return { position: absolute; inset: 0; visibility: hidden; }
.is-expanded .cover-return { visibility: visible; }
.profile { position: sticky; top: var(--cover-pinned); z-index: 4; height: var(--profile-height); padding: 48px 24px 16px; text-align: center; background: var(--paper); }
.profile::after { content: ""; pointer-events: none; position: absolute; inset: 100% 0 auto; height: 18px; background: linear-gradient(var(--paper), transparent); }
.profile-avatar { position: absolute; top: calc(-1 * min(65px, var(--cover-pinned))); left: calc(50% - 51px); display: grid; place-items: center; width: 102px; height: 102px; overflow: hidden; border: 5px solid var(--paper); border-radius: 50%; background: #000; }
.profile-avatar img { width: 64px; height: 64px; object-fit: contain; }
.profile h1 { font-size: 28px; font-weight: 600; line-height: 1.35; }
.profile-name { margin-top: 6px; color: var(--muted); font-size: 12px; }
.reveal-link { display: inline-flex; align-items: center; justify-content: center; min-height: 27px; margin-top: 4px; color: var(--muted); font-size: 11px; }
.reveal-link:hover { color: var(--accent); }
.is-expanded .reveal-link { visibility: hidden; }
.home-page:not(.is-expanded) .profile { cursor: pointer; }
.information { position: relative; z-index: 1; padding-top: 24px; padding-bottom: max(40px, calc(100svh - var(--scroll-offset) - 150px)); }
.section { margin-bottom: 28px; }
.section h2 { margin-bottom: 14px; font-size: 18px; font-weight: 600; line-height: 1.6; }
.section h3 { font-size: 15px; font-weight: 600; line-height: 1.4; }
.link-card { position: relative; display: flex; align-items: center; gap: 14px; min-height: 82px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); transition: background 140ms, border-color 140ms; }
.link-card:hover, .direction-card:hover { background: var(--card-hover); border-color: color-mix(in srgb, var(--ink) 35%, transparent); }
.link-card:active, .direction-card:active { background: var(--card-pressed); }
.card-icon { display: inline-grid; flex: 0 0 auto; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--icon-bg); color: var(--ink); }
.card-icon img { width: 28px; height: 28px; object-fit: contain; }
.card-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.work-icon { background: #000; }
.work-card :is(h2, h3) { margin: 0; font-size: 17px; font-weight: 600; }
.direction-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.direction-card { display: flex; align-items: center; gap: 14px; min-height: 82px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); transition: background 140ms, border-color 140ms; }
.direction-card .card-icon { width: 34px; height: 34px; background: transparent; color: var(--accent); }
.direction-card h3 { font-size: 14px; }
.developer-row { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 14px; }
.developer-identity h3 { margin-bottom: 14px; font-size: 16px; }
.developer-identity p, .website-row { color: var(--muted); font-size: 13px; }
.text-link { color: var(--accent); }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.channel-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.link-copy { min-width: 0; }
.link-copy p { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.github-dark { display: none; }
:root[data-theme="amber"] .github-light { display: none; }
:root[data-theme="amber"] .github-dark { display: block; }
.bilibili-icon { width: 28px; height: 28px; object-fit: contain; }
.sponsor-card { min-height: 94px; border-color: var(--sponsor-line); color: var(--sponsor); background: var(--sponsor-bg); }
.sponsor-card .card-icon { background: var(--sponsor-bg); }
.sponsor-card h3 { font-size: 18px; }
.sponsor-card:hover { border-color: var(--sponsor-line); background: var(--sponsor-hover); }
.sponsor-card:active { background: color-mix(in srgb, var(--sponsor) 23%, transparent); }
.sponsor-note { margin-top: 14px; color: var(--muted); font-size: 12px; line-height: 1.7; }
/* Direction pages use the same floating identity and vertical navigation. */
.portfolio-page { --scroll-offset: 40px; }
.portfolio-main { padding-top: 112px; padding-bottom: 48px; }
.back-link { display: inline-block; margin-bottom: 24px; color: var(--muted); font-size: 12px; }
.back-link:hover { color: var(--accent); }
.portfolio-main h1 { margin-bottom: 28px; font-size: 28px; font-weight: 600; }
.project-list { display: grid; gap: 12px; }
.empty-state { padding: 28px 0; color: var(--muted); }
@media (max-width: 900px) {
  :root { --rail-width: 138px; }
  .side-rail { left: 10px; width: 128px; }
  .floating-brand { left: 20px; font-size: 13px; gap: 8px; }
  .direction-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  :root { --rail-width: 92px; --profile-height: 142px; --cover-height: max(260px, calc(100svh - 142px)); }
  .floating-brand { top: 18px; left: 16px; }
  .floating-brand img { width: 26px; height: 26px; }
  .side-rail { left: 5px; width: 55px; max-height: calc(100svh - 140px); padding: 4px 0; }
  .side-nav { gap: 7px; }
  .side-nav a { font-size: 10px; }
  .theme-button { min-width: 32px; min-height: 32px; margin-top: 18px; padding: 6px; font-size: 10px; }
  .theme-button [data-theme-label] { flex-shrink: 0; max-height: 24px; line-height: 12px; }
  .side-rail:is(:hover, :focus-within) .theme-button [data-theme-label] { max-width: 2em; margin-left: 5px; white-space: normal; word-break: break-all; }
  [data-theme-icon] { width: 12px; font-size: 13px; }
  .page-width { width: calc(100% - 120px); }
  .profile { padding-top: 43px; }
  .profile-avatar { width: 96px; height: 96px; top: calc(-1 * min(59px, var(--cover-pinned))); left: calc(50% - 48px); }
  .profile-avatar img { width: 60px; height: 60px; }
  .profile h1 { font-size: 26px; }
  .profile-name { margin-top: 5px; font-size: 11px; }
  .information { padding-top: 24px; }
  .section h2 { font-size: 17px; }
  .channel-list { grid-template-columns: 1fr; }
  .developer-row { align-items: start; flex-direction: column; gap: 14px; }
  .website-row { font-size: 12px; }
  .link-card, .direction-card { padding-inline: 18px; }
  .sponsor-card h3 { font-size: 16px; }
  .portfolio-main { padding-top: 92px; }
  .portfolio-main h1 { font-size: 24px; }
}
@media (hover: none) {
  .side-nav a { opacity: .7; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
