:root {
  --page: #0d0d14;
  --text: #ededf6;
  --header: #101018;
  --rule: #272532;
  --separator: #494551;
  --secondary: #b4b1c4;
  --muted: #aaa6ba;
  --accent: #d4caff;
  --focus: #b7a7ff;
  --hover: #22202d;
  --selected: #282139;
  --selected-text: #d0baff;
  --indicator: #ac89ff;
  --surface: #16151f;
  --border: #353240;
  --button: #302a42;
  --button-text: #ded1ff;
  --hover-border: #705b91;
  --icon: #b8adc9;
  --detail: #1b1828;
  --intro-text: #c2bed2;
  --intro-start: #1b1932;
  --intro-mid: #201b3f;
  --intro-end: #19162c;
  --intro-border: #373048;
  --input: #fff;
}
:root[data-theme="light"] {
  color-scheme: light;
  --page: #f5f5fa;
  --text: #201e2c;
  --header: #ffffff;
  --rule: #dedde7;
  --separator: #c6c2d2;
  --secondary: #514c60;
  --muted: #645f73;
  --accent: #604597;
  --focus: #795ac1;
  --hover: #f3eff9;
  --selected: #eae1fb;
  --selected-text: #503180;
  --indicator: #8460be;
  --surface: #ffffff;
  --border: #d8d5e1;
  --button: #eee8f8;
  --button-text: #624589;
  --hover-border: #997ebd;
  --icon: #655977;
  --detail: #eeebf5;
  --intro-text: #58506b;
  --intro-start: #f1ecfb;
  --intro-mid: #e7e0f4;
  --intro-end: #d7cce7;
  --intro-border: #d8cde7;
  --input: #201e2c;
}
.header-actions { display:flex; align-items:center; gap:14px; }
#theme-toggle { display:inline-flex; align-items:center; gap:5px; min-height:36px; border:1px solid var(--border); }
#theme-toggle span { font-size:17px; line-height:1; }
@media(max-width:400px){ .header-actions {gap:6px;} }
@media(max-width:350px){ .brand i,.brand span{display:none;} }
* {
  box-sizing: border-box;
}
html {
  color-scheme: dark;
}
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font:
    15px/1.6 Inter,
    "Microsoft YaHei",
    system-ui,
    sans-serif;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input {
  font: inherit;
}
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
header {
  background: var(--header);
  border-bottom: 1px solid var(--rule);
}
.bar,
main,
footer {
  width: min(1280px, calc(100% - 8vw));
  margin: auto;
}
.bar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}
.brand img {
  width: 35px;
  height: 35px;
  border-radius: 10px;
}
.brand b {
  font-size: 20px;
  letter-spacing: 0.04em;
}
.brand i {
  height: 18px;
  border-left: 1px solid var(--separator);
}
.brand span,
.catalog-link {
  font-size: 13px;
  color: var(--secondary);
}
.catalog-link {
  color: var(--accent);
}
.intro {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  margin: 30px 0;
  background: linear-gradient(108deg, var(--intro-start), var(--intro-mid) 58%, var(--intro-end));
  border: 1px solid var(--intro-border);
  border-radius: 18px;
  padding: 35px 40px;
  min-height: 160px;
  display: flex;
  align-items: center;
}
.intro h1,
.detail-top h1 {
  font-size: clamp(32px, 3.4vw, 52px);
  line-height: 1.15;
  margin: 0 0 14px;
  letter-spacing: -0.05em;
}
.intro p,
.detail-top p {
  margin: 0;
  color: var(--intro-text);
}
.hero-art {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 48%;
  background:
    linear-gradient(90deg, var(--intro-mid), transparent 39%),
    url("/art/header.webp") center 47% / cover;
}
.workspace {
  display: grid;
  grid-template-columns: 207px minmax(0, 1fr);
  gap: 36px;
}
aside {
  align-self: start;
  position: sticky;
  top: 18px;
  border-right: 1px solid var(--rule);
  padding: 8px 20px 0 0;
}
aside h2 {
  font-size: 14px;
  color: var(--muted);
  margin: 0 12px 18px;
}
aside nav {
  display: grid;
  gap: 6px;
}
aside a {
  display: flex;
  padding: 10px 12px;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  border-radius: 8px;
  color: var(--secondary);
}
aside a:hover,
.pagination a:hover {
  background: var(--hover);
}
.selected {
  background: var(--selected) !important;
  color: var(--selected-text);
  box-shadow: inset 2px 0 var(--indicator);
}
.symbol {
  width: 17px;
  text-align: center;
}
.selected .symbol {
  color: var(--accent);
}
aside small {
  margin-left: auto;
  font-family: monospace;
}
.tools,
.tools > div {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tools {
  justify-content: space-between;
  margin: 0 0 15px;
  flex-wrap: wrap;
}
.tools h2,
.story h2 {
  font-size: 21px;
  margin: 0;
}
.tools small,
.example {
  color: var(--muted);
  font-size: 12px;
}
#search {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px 4px 3px 11px;
  gap: 8px;
}
#search span {
  font-size: 23px;
  color: var(--accent);
}
input {
  min-width: 0;
  background: none;
  border: 0;
  color: var(--input);
  width: 155px;
  font-size: 13px;
}
button {
  cursor: pointer;
  border: 0;
  border-radius: 6px;
  background: var(--button);
  color: var(--button-text);
  padding: 5px 12px;
  font-size: 13px;
}
.rows {
  display: grid;
  gap: 11px;
}
.case {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) 32px;
  gap: 24px;
  align-items: center;
  padding: 10px 21px 10px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  transition:
    background 0.18s,
    border-color 0.18s;
}
.case:hover {
  background: var(--hover);
  border-color: var(--hover-border);
}
.cover {
  width: 100%;
  aspect-ratio: 1.88;
  object-fit: cover;
  border-radius: 7px;
}
.chip {
  display: inline-block;
  font-size: 11px;
  line-height: 1.7;
  color: var(--button-text);
  background: var(--button);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0 7px;
}
.case h3 {
  font-size: 20px;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 5px 0;
}
.case p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.arrow {
  color: var(--icon);
  font-size: 21px;
  text-align: center;
  transition: transform 0.18s;
}
.case:hover .arrow {
  transform: translate(2px, -2px);
  color: var(--selected-text);
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin: 18px 0;
}
.pagination a {
  padding: 4px 11px;
  border-radius: 6px;
  color: var(--icon);
}
.pagination [aria-current] {
  background: var(--selected);
  color: var(--selected-text);
}
.empty {
  padding: 50px 16px;
  text-align: center;
  color: var(--secondary);
}
.empty a {
  color: var(--accent);
  margin-left: 10px;
}
footer {
  display: flex;
  gap: 16px;
  border-top: 1px solid var(--rule);
  margin: 30px auto 0;
  padding: 18px 0;
  color: var(--muted);
  font-size: 12px;
}
.back {
  display: inline-block;
  margin: 28px 0 18px;
  color: var(--accent);
}
.detail-top {
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  align-items: center;
  grid-template-columns: 1fr 40%;
  background: var(--detail);
}
.detail-top > div {
  padding: 30px 40px;
}
.detail-top h1 {
  margin: 18px 0;
}
.detail-top img {
  width: 100%;
  height: 260px;
  object-fit: cover;
}
.example {
  margin-left: 9px;
}
.story {
  max-width: 850px;
  margin: 38px auto 60px;
}
.story p {
  color: var(--secondary);
  line-height: 1.95;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.story img {
  width: 100%;
  border-radius: 12px;
  margin: 12px auto;
}
.case h3,
.case p,
.detail-top h1 {
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .bar,
  main,
  footer {
    width: calc(100% - 32px);
  }
  .bar {
    height: 58px;
  }
  .intro {
    margin: 18px 0;
    padding: 25px;
    min-height: 130px;
  }
  .hero-art {
    left: 52%;
    opacity: 0.65;
  }
  .workspace {
    display: block;
  }
  aside {
    position: static;
    border: 0;
    padding: 0;
    margin: 0 0 20px;
  }
  aside h2 {
    display: none;
  }
  aside nav {
    display: flex;
    overflow: auto;
    gap: 4px;
  }
  aside a {
    white-space: nowrap;
    padding: 7px 10px;
    gap: 5px;
  }
  aside .symbol {
    display: none;
  }
  .tools {
    gap: 10px;
  }
  .case {
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 12px;
    padding: 8px;
  }
  .cover {
    aspect-ratio: 1.3;
  }
  .arrow {
    display: none;
  }
  .case h3 {
    font-size: 17px;
  }
  .case p {
    font-size: 12px;
  }
  .tools h2 {
    font-size: 18px;
  }
  #search input {
    width: 108px;
  }
  .detail-top {
    display: flex;
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .detail-top > div {
    padding: 22px;
  }
  .detail-top img {
    height: 180px;
  }
  .story {
    margin: 22px 2px;
  }
  .brand {
    gap: 8px;
  }
  .brand b {
    font-size: 17px;
  }
  .intro p {
    font-size: 13px;
    max-width: 63%;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
