:root {
  --platform-bg: #f6f8fc;
  --platform-paper: #fff;
  --platform-ink: #161d32;
  --platform-muted: #515e75;
  --platform-line: #dce2ef;
  --platform-accent: #3744ca;
  --platform-soft: #e8ecff;
  --platform-mono: "Cascadia Code", Consolas, monospace;
}

.platform-page, .platform-route { color: var(--platform-ink); background: var(--platform-bg); }
.platform-page { margin: 0; font: 15px/1.6 "Noto Sans SC", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; }
.platform-page *, .platform-page *::before, .platform-page *::after { box-sizing: border-box; }
.platform-page h1, .platform-page h2, .platform-page p { margin: 0; }
.platform-page button, .platform-page input, .platform-page select { font: inherit; color: inherit; }
.platform-page button, .platform-page select { cursor: pointer; }
.platform-page [hidden] { display: none !important; }
.platform-header :focus-visible, .platform-page :focus-visible { outline: 3px solid #515fe4; outline-offset: 4px; }

.platform-inner, .platform-main { width: min(1280px, calc(100% - 96px)); margin-inline: auto; }
.platform-header { background: #f8f9fe; border-bottom: 1px solid var(--platform-line); }
.platform-inner { display: flex; align-items: center; gap: 36px; min-height: 72px; }
.platform-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--platform-ink); font-size: 22px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.platform-mark { position: relative; width: 35px; height: 27px; flex: none; }
.platform-mark::before, .platform-mark::after { content: ""; position: absolute; top: 1px; width: 15px; height: 22px; background: #3949da; }
.platform-mark::before { left: 1px; border-radius: 3px 6px 1px 3px; transform: skewY(14deg); }
.platform-mark::after { right: 1px; border-radius: 6px 3px 3px 1px; transform: skewY(-14deg); background: #5261e8; }
.platform-nav { display: flex; align-items: center; gap: 6px; padding-left: 27px; border-left: 1px solid var(--platform-line); }
.platform-nav a { color: #3f4b64; border-radius: 8px; padding: 8px 13px; font-size: 14px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.platform-nav a:hover { background: #f0f2ff; }
.platform-nav a[aria-current="page"] { color: #2635af; background: var(--platform-soft); }
.platform-main { padding-block: 40px 64px; }
.area-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 22px; }
.area-heading h1 { font-size: clamp(34px, 4.1vw, 52px); font-weight: 840; line-height: 1.17; letter-spacing: -.045em; }
.area-heading a, .library-links a { color: var(--platform-accent); text-decoration: none; font-weight: 700; }
.area-heading a:hover, .library-links a:hover { text-decoration: underline; text-underline-offset: 4px; }

.experiment-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.experiment-card { display: block; overflow: hidden; min-width: 0; color: var(--platform-ink); text-decoration: none; border: 1px solid #cdd5ec; border-radius: 15px; background: var(--platform-paper); transition: border-color .18s, transform .18s, box-shadow .18s; }
.experiment-card:hover { border-color: #6876df; transform: translateY(-3px); box-shadow: 0 6px 18px #273c9214; }
.experiment-art { aspect-ratio: 2.22; display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid #d5ddf3; }
.neural { background: #e7ecff; }
.attention { background: #eeecfb; }
.training { background: #def3f3; }
.field { background: #e9eefa; }
.engine { background: #e0eef6; }
.experiment-art canvas { display: block; width: 100%; height: 100%; aspect-ratio: 16 / 7; object-fit: contain; }
.experiment-copy { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 15px 17px; }
.experiment-copy h2 { font-size: clamp(16px, 1.5vw, 21px); font-weight: 780; line-height: 1.3; }
.experiment-copy span { color: var(--platform-accent); }

.library-toolbar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.library-search { display: flex; align-items: center; gap: 12px; flex: 1 1 295px; max-width: 580px; min-height: 44px; background: #fff; border: 1px solid #cfd8e9; border-radius: 10px; padding-inline: 13px; }
.library-search:focus-within { border-color: #646fe6; }
.library-search input { width: 100%; min-width: 0; padding: 10px 0; line-height: 1.4; border: 0; background: none; }
.library-search input:focus-visible { outline-offset: 1px; }
.library-search input::placeholder { color: #5d6880; opacity: 1; }
.search-icon { position: relative; width: 14px; height: 14px; flex: none; border: 1.8px solid #646e86; border-radius: 50%; margin-right: 2px; }
.search-icon::after { content: ""; position: absolute; right: -5px; bottom: -3px; width: 6px; height: 1.7px; transform: rotate(45deg); background: #646e86; border-radius: 2px; }
.library-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; color: var(--platform-muted); }
.library-tools select { border: 1px solid #d1d8e8; border-radius: 8px; background: white; padding: 8px 10px; }
.platform-page .text-button { border: 0; background: none; color: var(--platform-accent); padding: 6px 0; }
.text-button:hover { text-decoration: underline; }
.library-links, .tabs { display: flex; flex-wrap: wrap; gap: 7px 12px; }
.library-links { margin-top: 14px; font-size: 13px; }
.tabs { margin: 20px 0 14px; gap: 7px; }
.platform-page .tab { background: #fff; border: 1px solid #d8dfed; border-radius: 7px; padding: 5px 9px; color: #47546f; font-size: 13px; }
.platform-page .tab:hover { border-color: var(--platform-accent); }
.platform-page .tab[aria-pressed="true"] { background: var(--platform-accent); border-color: var(--platform-accent); color: #fff; }
.platform-page .status { min-height: 20px; color: var(--platform-muted); margin-bottom: 12px; font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.card-shell { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--platform-line); border-radius: 12px; background: #fff; }
.card-shell:hover { border-color: #929fe4; }
.card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 15px; height: 100%; color: var(--platform-ink); text-decoration: none; overflow-wrap: anywhere; }
.card .t { font-size: 16px; font-weight: 770; }
.card .c { color: #3345aa; background: #edf0ff; border-radius: 5px; padding: 1px 6px; font-size: 11px; }
.card .d, .card .meta, .card .p { color: var(--platform-muted); font-size: 12px; }
.card .p { font-family: var(--platform-mono); font-size: 11px; }
.image-links { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 0 15px 12px; font-size: 12px; }
.image-links a { color: var(--platform-accent); }
.empty { padding: 30px 0; color: var(--platform-muted); }

.platform-route .hero { padding: 36px 20px 30px; color: var(--platform-ink); background: #ebefff; border-bottom: 1px solid #d6def6; }
.platform-route .hero h1 { color: var(--platform-ink); font-size: clamp(30px, 4.1vw, 48px); }
.platform-route .hero p { color: var(--platform-muted); opacity: 1; }

@media (max-width: 825px) {
  .platform-inner, .platform-main { width: calc(100% - 44px); }
  .experiment-grid, .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .platform-inner, .platform-main { width: calc(100% - 28px); }
  .platform-inner { flex-wrap: wrap; gap: 4px 10px; padding-block: 10px; }
  .platform-brand { font-size: 19px; }
  .platform-mark { transform: scale(.85); margin-right: -3px; }
  .platform-nav { width: 100%; gap: 3px; border-left: 0; padding-left: 0; }
  .platform-nav a { padding: 6px 10px; }
  .platform-main { padding-block: 24px 42px; }
  .experiment-grid, .grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .platform-route .hero { padding: 24px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .experiment-card { transition: none; }
}
