:root {
  color-scheme: light;
  --base: #f7f7f3;
  --panel: #fff;
  --ink: #222621;
  --muted: #5b645c;
  --line: #dbdfd8;
  --quiet: #edefea;
  --accent: #2448b7;
  --accent-soft: #e9edfa;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-family: var(--font);
  background: var(--base);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
h1, h2, h3, p, figure, ol { margin: 0; }
.frame { width: min(1512px, calc(100% - 80px)); margin-inline: auto; }
.top { border-bottom: 1px solid var(--line); background: var(--base); }
.top-inner { min-height: 60px; display: flex; align-items: center; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-size: .99rem; font-weight: 780; letter-spacing: -.015em; }
.mark {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--accent);
  position: relative;
}
.mark::before, .mark::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  background: #fff;
  top: 6px;
  left: 6px;
  border-radius: 1px;
}
.mark::after { top: 13px; left: 13px; }
.layout { display: grid; grid-template-columns: 204px minmax(0, 1fr); gap: 30px; align-items: start; padding-block: 24px 52px; }
.library { min-width: 0; position: sticky; top: 16px; border-right: 1px solid var(--line); padding-right: 15px; }
.library-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 1px 2px 11px; }
.library-title h2 { font-size: .97rem; font-weight: 760; }
.library-title span { color: var(--muted); font-size: .78rem; }
.search {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  padding-inline: 9px;
  margin-bottom: 8px;
}
.search:focus-within { border-color: #7d8db2; }
.search input { min-width: 0; width: 100%; height: 35px; padding: 0; border: 0; outline: none; background: none; font-size: .84rem; }
.search input::placeholder { color: #667068; }
.search-icon { width: 11px; height: 11px; flex: 0 0 auto; border: 1.3px solid var(--muted); border-radius: 50%; position: relative; }
.search-icon::after { content: ""; position: absolute; top: 8px; left: 7px; width: 5px; height: 1.2px; background: var(--muted); transform: rotate(45deg); }
.filters { display: flex; padding: 3px; gap: 2px; border-radius: 7px; background: var(--quiet); }
.filters button { flex: 1; min-height: 31px; border: 0; border-radius: 5px; padding: 4px 7px; background: transparent; font-size: .82rem; white-space: nowrap; }
.filters button[aria-pressed="true"] { font-weight: 720; background: var(--panel); box-shadow: 0 1px 3px #17251d14; }
.cases { max-height: calc(100dvh - 190px); overflow: auto; margin-top: 13px; scrollbar-width: thin; }
.case-group + .case-group { margin-top: 14px; }
.case-group h3 { margin: 0 8px 5px; color: var(--muted); font-weight: 720; font-size: .76rem; }
.case-link {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 7px;
  border-radius: 6px;
  border-left: 2px solid transparent;
  font-size: .84rem;
  line-height: 1.4;
}
.case-link:hover { background: var(--quiet); }
.case-link[aria-current="true"] { border-left-color: var(--accent); background: var(--accent-soft); color: #1b3993; font-weight: 720; }
.case-code, .case-count, .specs, .elapsed { font-variant-numeric: tabular-nums; }
.case-code, .case-count { color: var(--muted); font-size: .71rem; }
.gallery { min-width: 0; }
.case-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 17px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.overline { color: var(--muted); font-size: .78rem; line-height: 1.5; letter-spacing: .01em; }
.case-head h1 { font-size: clamp(1.9rem, 4.1vw, 2.8rem); letter-spacing: -.06em; line-height: 1.15; font-weight: 780; }
.case-head .overline { margin-bottom: 6px; }
.case-spec { margin-top: 7px; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.case-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #c9d0c9;
  border-radius: 6px;
  background: var(--panel);
  font-weight: 680;
  font-size: .84rem;
  line-height: 1.35;
  white-space: nowrap;
}
.button:hover { border-color: #8190b7; color: var(--accent); }
.button[aria-pressed="true"] { color: #fff; border-color: var(--accent); background: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 14px; }
.work { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); overflow: hidden; }
.work-heading { padding: 10px 11px 8px; }
.work-heading h2 { font-size: clamp(.85rem, 1.25vw, 1.02rem); overflow-wrap: anywhere; line-height: 1.34; font-weight: 740; }
.specs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 5px; color: var(--muted); font-size: .76rem; }
.elapsed { color: #244092; background: var(--accent-soft); border-radius: 4px; padding: 2px 5px; font-weight: 650; }
.stage {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 660px;
  background: #eef0ea;
  overflow: hidden;
  padding: 0;
  border: 0;
}
.ratio-tall .stage { aspect-ratio: 9 / 16; }
.stage-video { position: relative; background: #131713; }
.stage img, .stage video { width: 100%; height: 100%; display: block; object-fit: contain; }
.stage-video video { pointer-events: none; }
button.stage { cursor: zoom-in; }
.play-mark {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid #ffffff99;
  border-radius: 50%;
  background: #142117b8;
}
.play-mark::before { content: ""; margin-left: 4px; border-block: 8px solid transparent; border-left: 12px solid white; }
.stage-video.is-playing .play-mark { visibility: hidden; }
.link-button {
  display: inline-flex;
  border: 0;
  padding: 2px 0;
  background: transparent;
  color: #274398;
  font-size: .82rem;
  font-weight: 675;
}
.link-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.case-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 19px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .86rem; }
.case-footer a:last-child { margin-left: auto; }
.blank { border: 1px dashed var(--line); padding: 18px; border-radius: 8px; color: var(--muted); }
dialog {
  width: min(700px, calc(100% - 34px));
  max-height: calc(100dvh - 34px);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 17px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 19px 70px #14211735;
}
dialog::backdrop { background: #16221cb3; }
.dialog-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 11px; }
.dialog-header h2 { font-size: 1.21rem; overflow-wrap: anywhere; line-height: 1.3; }
.dialog-header .overline { margin-bottom: 2px; }
.close { min-width: 33px; font-size: 1.35rem; line-height: 1; padding-inline: 6px; }
.input-content { display: grid; grid-template-columns: minmax(0, 1fr); gap: 15px; }
.input-content.with-material { grid-template-columns: minmax(0, 1fr) minmax(130px, 27%); }
.prompt textarea { display: block; min-height: 210px; width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--base); resize: vertical; font-size: .91rem; line-height: 1.65; }
.prompt .link-button { margin-top: 7px; }
.materials { min-width: 0; display: grid; align-content: start; gap: 12px; }
.material-stage { width: 100%; display: block; padding: 0; border: 0; border-radius: 7px; overflow: hidden; background: var(--quiet); cursor: zoom-in; }
.material-stage img { display: block; width: 100%; height: auto; max-height: 230px; object-fit: contain; }
.materials figcaption { margin-top: 5px; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.materials figcaption p { margin-top: 3px; }
.viewer { width: min(1000px, calc(100% - 28px)); }
.viewer-media { background: var(--quiet); border-radius: 7px; overflow: hidden; }
.viewer-media img, .viewer-media video { display: block; max-width: 100%; max-height: 72dvh; margin-inline: auto; }
@media (max-width: 1150px) {
  .frame { width: calc(100% - 45px); }
  .layout { grid-template-columns: 175px minmax(0, 1fr); gap: 18px; }
  .grid { gap: 10px; }
  .library { padding-right: 10px; }
}
@media (max-width: 950px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 710px) {
  .frame { width: calc(100% - 28px); }
  .top-inner { min-height: 52px; }
  .layout { display: block; padding-top: 12px; }
  .library { position: static; padding: 0 0 11px; margin-bottom: 12px; border: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 7px; }
  .library-title { display: none; }
  .search { min-width: 0; margin: 0; }
  .filters button { padding-inline: 9px; }
  .cases { grid-column: 1 / -1; display: flex; overflow: auto; max-height: none; margin: 0; }
  .case-group { display: contents; }
  .case-group h3, .case-count { display: none; }
  .case-link { display: inline-flex; min-width: max-content; padding: 7px 8px; margin-right: 3px; }
  .case-head { align-items: flex-start; padding-bottom: 10px; margin-bottom: 10px; }
}
@media (max-width: 470px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .work-heading { padding: 8px; }
  .input-content.with-material { grid-template-columns: 1fr; }
  .materials { max-width: 220px; }
}
