@font-face {
  font-family: Geist;
  src: url("assets/fonts/Geist-Latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #fff;
  --ink: #191a1b;
  --ink-2: #646461;
  --ink-3: #6f706c;
  --well: #f7f7f6;
  --hair: #f2f2f0;
  --hover: #eaeae8;
  --edge: #ececea;
  --glass: #fff;
  --glass-strong: #fff;
  --field: #fafaf9;
  --shadow: 0 1px 2px rgb(20 20 20 / 8%), 0 10px 26px rgb(28 27 22 / 9%);
  --danger: #a72521;
  --ease-ui: cubic-bezier(.2,.8,.2,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --sans: Geist, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --mono: ui-monospace, Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151516;
  --ink: #f5f5f3;
  --ink-2: #adada9;
  --ink-3: #a1a19d;
  --well: #1e1e20;
  --hair: #262627;
  --hover: #303032;
  --edge: #303030;
  --glass: #1e1e20;
  --glass-strong: #232325;
  --field: #252526;
  --shadow: 0 1px 2px rgb(0 0 0 / 25%), 0 12px 30px rgb(0 0 0 / 20%);
  --danger: #ff7a70;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-padding-top: 82px; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; color: var(--ink); background: var(--bg); font: 400 14px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { color: inherit; border: 0; background: transparent; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex: none; }
:focus-visible { outline: 2px solid var(--ink-3); outline-offset: 3px; }
[hidden] { display: none !important; }
.glass { background: var(--glass); border: 1px solid var(--edge); box-shadow: var(--shadow); }

.topbar {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: minmax(140px, 1fr) minmax(210px, 342px) minmax(125px, 1fr);
  align-items: center; gap: 20px;
  height: 65px; padding: 0 28px; border-bottom: 1px solid var(--edge); background: var(--bg);
}
.header-start, .brand, .header-actions { display: flex; align-items: center; }
.header-start { gap: 29px; }
.brand { gap: 9px; flex: none; font-size: 17px; line-height: 1; font-weight: 650; letter-spacing: -.035em; }
.primary-nav a { font-size: 13px; font-weight: 580; white-space: nowrap; padding-block: 8px; }
.header-actions { justify-self: end; gap: 4px; }
.search {
  display: flex; align-items: center; gap: 9px; min-width: 0; height: 38px;
  padding: 0 10px 0 13px; border: 1px solid transparent; border-radius: 999px;
  background: var(--hair); color: var(--ink-2);
}
.search:focus-within { border-color: var(--ink-3); }
.search > svg { width: 16px; height: 16px; }
.search input { width: 100%; min-width: 0; border: 0; outline: none; background: none; color: var(--ink); font-size: 13px; }
.search input::placeholder { color: var(--ink-2); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { flex: none; padding: 3px 6px; border: 1px solid var(--edge); border-radius: 5px; background: var(--bg); font: 500 11px/1 Geist, monospace; white-space: nowrap; }
.shortcut-hidden { display: none; }
.icon-button, .language-button {
  display: inline-grid; place-items: center; min-width: 36px; height: 36px;
  border-radius: 999px; color: var(--ink-2); transition: background .16s, color .16s, scale .18s var(--ease-ui);
}
.icon-button svg { width: 17px; height: 17px; }
.icon-button:hover, .language-button:hover { color: var(--ink); background: var(--hair); }
.icon-button:active, .language-button:active { scale: .94; }
.icon-button[aria-pressed="true"] { color: var(--ink); background: var(--hair); }
.icon-button[aria-pressed="true"] svg { fill: currentColor; }
.language-button { font-size: 12px; font-weight: 620; padding-inline: 7px; }
.search .search-clear { min-width: 24px; height: 24px; font-size: 20px; line-height: 1; }

.wrap { width: calc(100% - 40px); margin-inline: auto; }
.intro { margin: 0 auto; max-width: 640px; text-align: center; padding: 96px 18px 73px; }
.intro h1 { font-size: clamp(42px, 5.1vw, 60px); line-height: 1.12; font-weight: 630; letter-spacing: -.055em; text-wrap: balance; }
:lang(zh-CN) .intro h1 { font-size: clamp(38px, 4.8vw, 55px); font-weight: 650; letter-spacing: -.045em; }
.intro p { margin: 15px 0 22px; color: var(--ink-2); font-size: 16px; text-wrap: balance; }
.browse, .pill {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  border-radius: 999px; padding: 0 15px; min-height: 38px; font-size: 13px; font-weight: 550;
}
.browse, .pill.solid { background: var(--ink); color: var(--bg); }
.browse:hover, .pill.solid:hover { opacity: .83; }
.browse svg { width: 15px; height: 15px; }
.pill { background: var(--hair); }
.pill:hover { background: var(--hover); }
.admin-bar { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; margin-bottom: 13px; }
.work-section.filtered { padding-top: 29px; }
.gallery-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.gallery-view-tools { display: flex; flex: none; align-items: center; gap: 17px; }
.gallery-toolbar .chips { min-width: 0; }
.view-switch {
  display: flex; flex: none; align-items: center; padding: 2px 5px; border-radius: 999px;
  border: 1px solid #ececef; background: #fff;
  box-shadow: 0 3px 14px rgb(25 26 27 / 7%), inset 0 1px 0 #fff;
}
.view-switch-button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; }
.view-switch-button > span {
  width: 24px; height: 24px; border-radius: 50%;
  background: radial-gradient(circle at 33% 28%, #f8f8fa 0, #e4e4e8 35%, #c7c7ce 74%, #b9b9c1 100%);
  box-shadow: inset 0 0 0 1px rgb(130 130 143 / 15%), 0 2px 4px rgb(25 26 27 / 15%);
  transition: transform .18s var(--ease-ui);
}
.view-switch-button:hover > span { transform: scale(1.08); }
.view-switch-button:active > span { transform: scale(.94); }
.view-switch-button[aria-pressed="true"] > span { background: #000; box-shadow: 0 2px 4px rgb(0 0 0 / 16%); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px; margin: -4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 35px; padding: 0 14px; border-radius: 999px; background: var(--hair); color: var(--ink-2); font-size: 13px; font-weight: 510; transition: color .16s, background .16s; }
.chip:hover { background: var(--hover); color: var(--ink); }
.chip[aria-pressed="true"] { color: var(--bg); background: var(--ink); }
.count { margin-right: 1px; color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 23px 12px; }
.project-card { min-width: 0; }
.stage {
  position: relative; isolation: isolate; display: grid; place-items: center; aspect-ratio: 1.48;
  border: 1px solid color-mix(in srgb, var(--edge), transparent 30%); border-radius: 27px;
  background: var(--well);
}
.stage-details { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; }
.stage-details:focus-visible { outline-offset: -4px; }
.project-frame {
  position: relative; z-index: 1; width: 74%; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 15px; background: var(--glass); box-shadow: var(--shadow); pointer-events: none;
}
.project-frame > img, .project-frame > video { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.project-frame > img { object-fit: cover; }
.project-frame > video { object-fit: contain; background: #111; pointer-events: auto; }
.cover-letter { display: grid; place-items: center; width: 100%; height: 100%; background: var(--hair); color: var(--ink-3); font-size: 40px; font-weight: 600; }
.password-cover { display: grid; place-items: center; isolation: isolate; background: var(--field); color: var(--ink); }
.password-cover > img { filter: blur(9px) saturate(.8); transform: scale(1.12); }
.password-cover-glass {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgb(255 255 255 / 48%), rgb(255 255 255 / 18%));
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  border: 1px solid rgb(255 255 255 / 52%); border-radius: inherit;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 45%);
}
.password-cover-label {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 17px 22px; border-radius: 18px; background: rgb(255 255 255 / 56%);
  border: 1px solid rgb(255 255 255 / 58%); box-shadow: 0 4px 16px rgb(25 26 27 / 6%);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
:root[data-theme="dark"] .password-cover-glass { background: linear-gradient(135deg, rgb(30 30 32 / 32%), rgb(30 30 32 / 12%)); border-color: rgb(255 255 255 / 20%); }
:root[data-theme="dark"] .password-cover-label { background: rgb(30 30 32 / 62%); border-color: rgb(255 255 255 / 22%); }
.password-cover svg { width: 30px; height: 30px; color: var(--ink); }
.password-cover span { font-size: 13px; font-weight: 500; }
.site-preview {
  position: absolute; top: 0; left: 0; display: block; border: 0; background: #fff; transform-origin: top left;
  opacity: 0; pointer-events: none; visibility: hidden;
}
[data-preview-state="ready"] .site-preview { opacity: 1; pointer-events: auto; visibility: visible; }
.video-start, .preview-toggle {
  display: grid; place-items: center; border-radius: 50%; pointer-events: auto;
  color: #191a1b; background: rgb(255 255 255 / 95%); box-shadow: 0 2px 9px rgb(0 0 0 / 14%);
}
.video-start { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 42px; height: 42px; }
.video-start svg { width: 23px; height: 23px; }
.preview-toggle { position: absolute; z-index: 1; right: 6px; bottom: 6px; width: 28px; height: 28px; opacity: 0; transition: opacity .16s; }
.preview-toggle svg { width: 16px; height: 16px; }
.stage:hover .preview-toggle, .stage:focus-within .preview-toggle, .preview-toggle[aria-pressed="true"] { opacity: 1; }
.bookmark { position: absolute; z-index: 2; top: 10px; right: 10px; min-width: 31px; height: 31px; }
.bookmark svg { width: 15px; height: 15px; }
.bookmark:hover, .bookmark[aria-pressed="true"] { background: var(--glass); }
.pin-button {
  position: absolute; z-index: 2; top: 10px; left: 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 60px; min-height: 32px; padding: 0 10px; border-radius: 999px;
  color: var(--ink-2); background: var(--glass); font-size: 11px; font-weight: 550;
  transition: background .16s, color .16s;
}
.pin-button svg { width: 14px; height: 14px; }
.pin-button:hover { color: var(--ink); background: var(--hover); }
.pin-button[aria-pressed="true"] { color: var(--bg); background: var(--ink); }
.pin-button[aria-pressed="true"] svg { fill: currentColor; }
.card-caption { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 9px 4px 0; }
.card-caption h2 { min-width: 0; font-size: 14px; line-height: 1.5; }
.project-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; text-align: start; vertical-align: bottom; font-weight: 585; }
.project-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.project-kind { flex: none; color: var(--ink-3); font-size: 11px; }
.import-card { align-content: center; gap: 5px; color: var(--ink-2); }
.import-card span { font-size: 30px; line-height: 1; }
.empty-results { display: grid; justify-items: center; align-content: center; gap: 13px; min-height: 210px; border-radius: 26px; background: var(--well); color: var(--ink-2); }
.site-footer { padding-top: 16px; margin-top: 54px; margin-bottom: 22px; border-top: 1px solid var(--edge); color: var(--ink-2); font-size: 12px; }

/* 弹窗通用：从被点击的卡片方向展开 */
dialog.sheet {
  width: min(1080px, calc(100% - 24px)); max-height: calc(100dvh - 24px); margin: auto; padding: 0; border-radius: 28px; color: var(--ink);
  background: var(--glass-strong); overflow: auto; overscroll-behavior: contain;
  -webkit-backdrop-filter: blur(40px) saturate(170%); backdrop-filter: blur(40px) saturate(170%);
  opacity: 0; transform: scale(.97);
  transition: opacity .18s var(--ease-ui), transform .18s var(--ease-ui), overlay .18s allow-discrete, display .18s allow-discrete;
}
dialog.sheet[open] { opacity: 1; transform: none; transition-duration: .46s; transition-timing-function: var(--ease-out); }
@starting-style { dialog.sheet[open] { opacity: 0; transform: scale(.9) translateY(10px); } }
dialog.sheet::backdrop { background: rgba(6, 7, 10, 0); transition: background .25s var(--ease-ui), overlay .25s allow-discrete, display .25s allow-discrete; }
dialog.sheet[open]::backdrop { background: rgba(6, 7, 10, .58); }
@starting-style { dialog.sheet[open]::backdrop { background: rgba(6, 7, 10, 0); } }
.close { position: absolute; top: 8px; right: 4px; width: 36px; height: 36px; border-radius: 50%; background: var(--hair); font-size: 18px; line-height: 1; transition: background .15s var(--ease-ui); }
.close:hover { background: rgba(255, 255, 255, .16); }

/* 详情 */
.sheet-in { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px; padding: 14px; }
.gallery .main { aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; background: var(--hair); }
.gallery .main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery .main.video { aspect-ratio: 16 / 9; }
.gallery .main video { width: 100%; height: 100%; object-fit: contain; display: block; }
.gallery .main .media { position: relative; inset: auto; width: 100%; height: 100%; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; }
.thumbs button { flex: 1; max-width: 25%; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; opacity: .55; transition: opacity .2s var(--ease-ui); outline-offset: 2px; }
.thumbs button:hover { opacity: .85; }
.thumbs button[aria-current="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.info { position: relative; padding: 18px 12px 12px 0; display: flex; flex-direction: column; }
.info h2 { font-size: clamp(26px, 3vw, 34px); line-height: 1.25; font-weight: 400; letter-spacing: -.015em; padding-right: 44px; }
.info .lead { margin-top: 16px; font-size: 15px; line-height: 1.8; color: var(--ink-2); white-space: pre-line; }
.facts { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin-top: 22px; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.facts div { padding: 14px 0; }
.facts div + div { padding-left: 14px; border-left: 1px solid var(--hair); }
.facts b { display: block; font-size: 22px; line-height: 1.1; font-weight: 400; font-variant-numeric: tabular-nums; }
.facts span { display: block; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.meta { margin-top: 18px; display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 14px; }
.meta dt { color: var(--ink-3); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: auto; padding-top: 24px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 500; transition: opacity .15s var(--ease-ui), background .15s var(--ease-ui), transform .4s var(--ease-out); }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.ghost { background: var(--hair); }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { color: var(--danger); background: rgba(255, 122, 112, .1); }
.btn[disabled] { opacity: .5; cursor: progress; }
.admin-actions { display: flex; gap: 8px; margin-left: auto; }
.admin-actions .btn { padding: 10px 16px; font-size: 13px; }

/* 教程：左边图片，右边说明 */
#tutorial { width: min(1180px, calc(100% - 24px)); }
.tut { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; padding: 14px; }
.tut-media { position: sticky; top: 14px; align-self: start; }
.tut-main { display: grid; place-items: center; border-radius: 18px; overflow: hidden; background: var(--well, var(--hair)); max-height: calc(100dvh - 190px); }
.tut-main img { max-width: 100%; max-height: calc(100dvh - 190px); object-fit: contain; display: block; }
.tut-cap { margin-top: 8px; font-size: 13px; color: var(--ink-3); text-align: center; }
.tut .thumbs button { aspect-ratio: 1; }
.tut-text { position: relative; padding: 18px 12px 18px 0; }
.tut-text h2 { font-size: clamp(24px, 2.6vw, 30px); line-height: 1.3; font-weight: 400; letter-spacing: -.01em; padding-right: 44px; }
.tut-text section { margin-top: 22px; }
.tut-text h3 { font-size: 15px; font-weight: 500; }
.tut-text p { margin-top: 8px; font-size: 15px; line-height: 1.8; color: var(--ink-2); white-space: pre-line; }

/* 表单 */
dialog.form-sheet { width: min(860px, calc(100% - 24px)); background: var(--glass-strong); }
#login { width: min(440px, calc(100% - 24px)); }
#memory-access { width: min(440px, calc(100% - 24px)); }
#memory-access .field input { font-size: 16px; }
#memory-access .field input[aria-invalid="true"] { border-color: var(--danger); }
#memory-access .form-msg { min-height: 1.6em; }
#memory-access .btn { min-height: 44px; }
.form { position: relative; padding: 28px clamp(18px, 4vw, 36px) 0; }
.form > .close { top: 18px; right: 18px; }
.form h2 { font-size: 24px; font-weight: 400; letter-spacing: -.01em; padding-right: 40px; }
.form .hint { margin-top: 10px; font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.form section { margin-top: 26px; }
.form h3 { font-size: 15px; font-weight: 500; color: var(--ink); margin-bottom: 12px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.row.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; color: var(--ink-2); }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--edge); background: var(--field);
  color: var(--ink); font: inherit; font-size: 14px; line-height: 1.5; transition: border-color .15s var(--ease-ui), background .15s var(--ease-ui);
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink-3); background: var(--hair); }
.field select option { background: var(--glass-strong); }
.field input[type="color"] { height: 42px; padding: 4px; cursor: pointer; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.facts-edit { display: grid; gap: 8px; }
.facts-edit .row { grid-template-columns: 1fr 1.4fr 1.4fr; }

.drop { position: relative; display: grid; place-items: center; min-height: 120px; padding: 18px; border-radius: 16px; border: 1.5px dashed var(--edge); text-align: center; transition: border-color .15s var(--ease-ui), background .15s var(--ease-ui); cursor: pointer; }
.drop.over, .drop:hover { border-color: var(--ink-3); background: var(--glass); }
.drop b { font-size: 14px; font-weight: 500; color: var(--ink); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 12px; }
.pic { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--hair); }
.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pic .tag { position: absolute; left: 6px; bottom: 6px; padding: 3px 8px; border-radius: 999px; font-size: 12px; color: #14171c; background: rgba(255, 255, 255, .78); }
.pic .ops { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.pic .ops button { width: 24px; height: 24px; border-radius: 50%; font-size: 13px; line-height: 1; color: #14171c; background: rgba(255, 255, 255, .82); }
.form-foot {
  --px: clamp(18px, 4vw, 36px);
  position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 28px calc(-1 * var(--px)) 0; padding: 14px var(--px) 18px; border-top: 1px solid var(--hair);
  background: var(--glass-strong); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.form-foot .left { display: flex; gap: 8px; flex-wrap: wrap; }
.form-foot .right { display: flex; gap: 8px; margin-left: auto; }
.json-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.json-tools label { position: relative; cursor: pointer; }
.json-tools input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.form-msg { margin-top: 14px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.form-msg.bad { color: var(--danger); }
.uid { display: flex; gap: 8px; align-items: center; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--field); border: 1px solid var(--edge); font: 400 13px/1.4 var(--mono); word-break: break-all; }

.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 50; transform: translateX(-50%); padding: 12px 18px; border-radius: 999px; font-size: 14px; background: var(--glass-strong); animation: toast .4s var(--ease-out); }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 14px); } }
.main .media { min-height: 220px; display: grid; background: var(--well); }


@media (max-width: 1000px) {
  .topbar { padding-inline: 22px; gap: 14px; }
  .intro { padding-top: 81px; padding-bottom: 64px; }
  .grid { gap: 21px 12px; }
  .stage { border-radius: 24px; }
}
@media (max-width: 760px) {
  .topbar { grid-template-columns: auto minmax(80px, 1fr) auto; padding-inline: 16px; height: 61px; gap: 11px; }
  .primary-nav, .search kbd { display: none; }
  .brand { gap: 6px; }
  .brand svg { width: 23px; height: 23px; }
  .search { height: 36px; }
  .header-actions { gap: 1px; }
  .header-actions button { min-width: 30px; }
  .wrap { width: calc(100% - 36px); }
  .intro { padding-top: 70px; padding-bottom: 55px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet-in { grid-template-columns: 1fr; gap: 8px; }
  .tut { grid-template-columns: 1fr; gap: 8px; }
  .tut-media { position: static; }
  .tut-text { padding: 10px 6px 8px; }
  #tutorial .close { position: fixed; top: 22px; right: 22px; z-index: 2; background: var(--glass-strong); }
  .info { padding: 10px 6px 8px; }
  #sheet .close { position: fixed; top: 22px; right: 22px; z-index: 2; background: var(--glass-strong); }
  .admin-actions { margin-left: 0; }
  .facts-edit .row { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  html { scroll-padding-top: 73px; }
  .topbar { height: 59px; padding-inline: 13px; gap: 9px; }
  .brand { font-size: 15px; }
  .brand svg { width: 20px; height: 20px; }
  .search { padding-inline: 8px; gap: 5px; }
  .search > svg { width: 14px; height: 14px; }
  .wrap { width: calc(100% - 32px); }
  .intro { padding: 63px 16px 44px; }
  .intro h1 { font-size: 42px; }
  :lang(zh-CN) .intro h1 { font-size: 38px; }
  .intro p { font-size: 14px; margin: 12px 0 17px; }
  .gallery-toolbar { flex-wrap: wrap; margin-bottom: 11px; }
  .gallery-toolbar .chips { flex: 1 1 100%; }
  .gallery-view-tools { margin-left: auto; }
  .chip { height: 33px; padding-inline: 11px; font-size: 12px; }
  .count { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
@media (hover: none) {
  .preview-toggle { opacity: 1; }
  .pin-button { min-height: 44px; }
  .bookmark { min-width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}


.card-demo { position: relative; z-index: 1; width: 74%; pointer-events: none; }
.demo-view {
  display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 15px; background: var(--glass); box-shadow: var(--shadow);
}
.demo-view > img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  pointer-events: none; user-select: none;
}
.card-demo[data-demo="harbor"] { width: 72%; }
.card-demo[data-demo="harbor"] .demo-view > img { opacity: 0; transition: opacity .25s ease; }
.card-demo[data-demo="harbor"] .demo-view > img.visible { opacity: 1; }
.harbor-scenes {
  display: flex; align-items: center; gap: 2px; width: max-content; margin: 10px auto 0; padding: 3px;
  border: 1px solid var(--edge); border-radius: 999px; background: var(--glass); box-shadow: 0 1px 3px rgb(0 0 0 / 10%);
}
.harbor-scenes button {
  min-height: 26px; padding: 1px 10px; border-radius: 999px; font-size: 11px; font-weight: 570;
  color: var(--ink-2); pointer-events: auto;
}
.harbor-scenes button:hover, .harbor-scenes button[aria-pressed="true"] { color: var(--ink); background: var(--hair); }
.particle-preview { cursor: crosshair; pointer-events: auto; }
.card-demo[data-demo="earth"] { width: min(46%, 248px); }
.earth-globe {
  display: block; width: 100%; height: auto; cursor: grab; pointer-events: auto; touch-action: pan-y;
  border-radius: 50%; filter: drop-shadow(0 13px 15px rgb(12 35 42 / 14%));
}
.earth-globe[data-dragging="true"] { cursor: grabbing; }
.card-demo[data-demo="jolly"] { width: min(43%, 210px); }
.card-demo > img { display: block; width: 100%; border-radius: 15px; }
.jolly-gaze {
  position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; overflow: hidden; pointer-events: auto;
  background: url("assets/card-jolly-gaze.webp") no-repeat center / 300% 300%;
}
.jolly-gaze[data-ready="true"] { background-image: none; }
.jolly-sprite {
  position: absolute; top: 0; left: 0; display: block; max-width: none;
  pointer-events: none; user-select: none; will-change: transform; visibility: hidden;
}
.jolly-gaze[data-ready="true"] .jolly-sprite { visibility: visible; }
.project-frame.pond-preview { aspect-ratio: 720 / 332; }
.particle-preview { aspect-ratio: 560 / 268; background: #111015; }
.card-demo[data-demo="mono"] .particle-preview { background: #fdfdfb; }
.particle-preview canvas { display: block; width: 100%; height: 100%; }
.preview-next {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: auto; border-radius: inherit;
}
.preview-count {
  position: absolute; right: 7px; bottom: 7px; padding: 2px 7px;
  color: #fff; background: rgb(23 23 23 / 72%); border-radius: 999px; font-size: 10px;
}
.project-frame[data-preview-state="ready"] .preview-next { display: none; }

