:root {
  color-scheme: light;
  --bg: #f7f8fc;
  --ink: #1b2337;
  --muted: #687286;
  --line: #e7e9f2;
  --violet: #5550cb;
  --violet-dark: #443eb8;
  --tint: #eeedff;
  font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }
button { color: inherit; }
button svg, label svg { flex-shrink: 0; vertical-align: middle; }
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100dvh; min-height: 0; background: #fff; border-right: 1px solid var(--line); padding: 25px 15px 17px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 5px 26px; white-space: nowrap; }
.logo { display: inline-grid; width: 37px; height: 37px; flex: 0 0 37px; place-items: center; color: white; background: linear-gradient(140deg, #7c74ef, #5249d3); box-shadow: 0 3px 8px #594fcf39; border-radius: 11px; font-size: 21px; }
.brand strong { display: block; font-size: 15px; letter-spacing: .01em; }
.brand small { display: block; margin-top: 4px; color: #737b91; font-size: 8px; font-weight: 750; letter-spacing: .13em; }
.nav { display: grid; gap: 4px; }
.nav-item { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 8px; min-height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 9px; color: #424d62; text-align: left; font-size: 13px; }
.nav-item:hover { background: #f5f5fb; }
.nav-item[href] { text-decoration: none; }
.nav-item.active { background: var(--tint); color: var(--violet-dark); border-color: #e8e5ff; font-weight: 700; }
.nav-item span { flex: 1; overflow-wrap: anywhere; }
.nav-item small { color: #6e7590; font-variant-numeric: tabular-nums; font-size: 11px; }
.sidebar-section { margin-top: 20px; padding-top: 13px; border-top: 1px solid var(--line); flex: 1; display: flex; flex-direction: column; min-height: 0; }
.sidebar-title { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--muted); font-weight: 750; padding: 0 7px 7px; letter-spacing: .09em; }
.categories { overflow-y: auto; }
.category-row { position: relative; min-width: 0; }
.category-row .nav-item { padding-right: 34px; }
.category-more { position: absolute; right: 4px; bottom: 5px; }
.category-dot { flex: 0 0 8px; width: 8px; height: 8px; margin: 0 5px; border-radius: 50%; background: #a398df; }
.dot-1 { background: #7d9bd5; } .dot-2 { background: #79b6a9; } .dot-3 { background: #db967f; }
.dot-4 { background: #c1a176; } .dot-5 { background: #85a9c6; }
.sidebar-footer { display: flex; justify-content: space-between; align-items: center; gap: 5px; margin: 15px 3px 0; border-top: 1px solid var(--line); padding: 14px 2px 0; color: var(--muted); font-size: 11px; }
.sidebar-footer i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #55ad8a; margin-right: 7px; }
.main { min-width: 0; }
.masthead { display: flex; min-height: 69px; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 30px; border-bottom: 1px solid var(--line); background: #fff; }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: var(--muted); white-space: nowrap; font-size: 12px; }
.breadcrumb strong { color: #313a50; }
.slash { color: #a0a7b6; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.search { display: flex; align-items: center; gap: 8px; width: clamp(190px, 23vw, 350px); padding: 0 11px; min-height: 39px; border: 1px solid #e4e6f0; border-radius: 8px; background: #fafbfe; color: #70798c; }
.search:focus-within { border-color: #a69df7; }
.search input { border: 0; background: transparent; color: var(--ink); width: 100%; min-width: 0; font-size: 12px; padding: 9px 0; outline: none; }
.primary, .secondary, .danger { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 8px; min-height: 38px; padding: 0 13px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.primary { color: #fff; background: var(--violet); box-shadow: 0 2px 5px #4b42c824; }
.primary:hover { background: var(--violet-dark); }
.secondary { background: white; border-color: #dedff0; color: #45429d; }
.secondary:hover { background: #f6f4ff; }
.danger { background: #b72e48; color: white; }
.danger-text { color: #a62b43 !important; }
.plain, .icon { border: 0; background: transparent; border-radius: 7px; padding: 4px; color: var(--muted); }
.plain:hover, .icon:hover { background: #f0eff8; color: var(--violet-dark); }
.icon { width: 28px; height: 28px; display: inline-grid; place-items: center; }
.more-trigger { color: #8891a5; font-size: 14px; font-weight: 600; line-height: 1; }
.more-trigger[aria-expanded="true"] { background: var(--tint); color: var(--violet-dark); }
.more-menu { position: fixed; inset: auto; margin: 0; width: 130px; padding: 4px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px #29245926; }
.more-menu button { display: block; width: 100%; height: 34px; padding: 0 8px; text-align: left; border: 0; border-radius: 5px; background: transparent; font-size: 13px; }
.more-menu button:hover, .more-menu button:focus-visible { background: #f2f1fb; }
.content { max-width: 1950px; margin: auto; padding: 31px 30px 36px; }
.intro { margin-bottom: 24px; }
.eyebrow { display: flex; align-items: center; gap: 7px; color: #5750b8; font-size: 11px; font-weight: 750; letter-spacing: .09em; }
.eyebrow span { width: 7px; height: 7px; border-radius: 2px; background: #8c81e9; transform: rotate(45deg); }
h1, h2, h3, p { margin: 0; }
.intro h1 { font-size: clamp(25px, 2.5vw, 35px); margin: 9px 0 6px; letter-spacing: -.035em; line-height: 1.3; }
.intro p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 17px; }
.tabs { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid #e9eaf3; background: #eeeff6; border-radius: 9px; }
.tabs button { border: 0; border-radius: 6px; min-height: 30px; min-width: 53px; padding: 0 8px; display: inline-flex; gap: 5px; align-items: center; justify-content: center; background: transparent; color: #626b80; font-size: 12px; white-space: nowrap; }
.tabs button svg { width: 14px; height: 14px; }
.tabs button.active { color: var(--violet-dark); background: white; font-weight: 700; box-shadow: 0 1px 3px #24284a16; }
.results { display: flex; align-items: center; gap: 12px; white-space: nowrap; color: var(--muted); font-size: 11px; }
.sort select { border: 1px solid var(--line); border-radius: 7px; min-height: 34px; padding: 0 7px; color: #4d586c; background: white; font-size: 11px; }
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 1px; grid-auto-flow: dense; column-gap: 18px; }
.gallery.is-empty { display: block; }
.card { position: relative; align-self: start; min-width: 0; overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 2px 6px #22264507; transition: border-color .16s, box-shadow .16s; }
.card:hover, .card:focus-within { border-color: #b8b1f0; box-shadow: 0 6px 18px #29245913; }
.card-open { display: block; border: 0; width: 100%; background: transparent; text-align: left; padding: 0; }
.card-open:focus-visible { outline-offset: -3px; }
.card-media { position: relative; background: #e9eaf2; overflow: hidden; }
.card-media.wide { aspect-ratio: 1.58; } .card-media.portrait { aspect-ratio: .89; } .card-media.poster { aspect-ratio: 1.1; }
.card-media img, .card-media video { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.card:hover .card-media img { transform: scale(1.025); }
.kind, .favorite, .play { color: white; background: #182037a8; border: 1px solid #ffffff59; backdrop-filter: blur(5px); }
.kind { display: flex; align-items: center; gap: 4px; position: absolute; left: 10px; top: 10px; padding: 4px 6px; border-radius: 6px; font-size: 10px; }
.kind svg { width: 12px; height: 12px; }
.favorite { display: grid; place-items: center; width: 32px; height: 32px; position: absolute; right: 9px; top: 9px; border-radius: 50%; }
.favorite:hover, .favorite.liked { background: #574dc9e8; }
.favorite.liked svg { fill: white; }
.play { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); border-radius: 50%; width: 40px; height: 40px; display: grid; place-items: center; font-size: 12px; }
.card-body { padding: 13px 12px 14px; }
.card-body .tags { padding-right: 29px; }
.shell.shared { display: block; }
.shared .card-body .tags { padding-right: 0; }
.card-more { position: absolute; right: 7px; bottom: 7px; }
.card-body h2 { font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.card-body p { margin: 4px 0 10px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tags span { display: inline-block; max-width: 100%; overflow-wrap: anywhere; padding: 3px 6px; border-radius: 4px; background: #f2f3f8; color: #586277; font-size: 10px; }
.tags .category-tag { color: #5149b3; background: #efedff; }
.empty { text-align: center; border: 1px dashed #dcdcf0; padding: 45px 14px; border-radius: 12px; background: #fff; }
.empty > svg { color: var(--violet); width: 28px; height: 28px; margin-bottom: 8px; }
.empty h2 { font-size: 17px; }
.empty p { margin: 9px 0 14px; color: var(--muted); font-size: 13px; }
dialog { padding: 0; border: 1px solid var(--line); border-radius: 15px; max-height: calc(100dvh - 32px); box-shadow: 0 14px 60px #10152f35; color: var(--ink); }
dialog::backdrop { background: #1c22486b; }
.detail { width: min(940px, calc(100vw - 30px)); }
.detail[open] { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.detail-media { display: grid; place-items: center; background: #141724; min-height: 330px; }
.detail-media img, .detail-media video { width: 100%; max-height: 73dvh; object-fit: contain; }
.detail-info { padding: 23px; min-width: 0; }
.dialog-header, .prompt-header, .detail-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dialog-header h2, .detail h2 { font-size: 21px; overflow-wrap: anywhere; }
.detail h2 { margin-top: 10px; }
.model, .dialog-header p { font-size: 12px; margin-top: 5px; color: var(--muted); overflow-wrap: anywhere; }
.prompt-header { margin: 23px 0 9px; }
.prompt-header h3 { font-size: 14px; }
.copy { min-height: 31px; font-size: 11px; }
.copy svg { width: 14px; height: 14px; }
.prompt { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 40dvh; overflow: auto; background: #f7f7fc; border: 1px solid var(--line); border-radius: 9px; padding: 13px; font-size: 13px; line-height: 1.8; }
.detail-tags { margin-top: 12px; }
.detail-actions { margin-top: 20px; }
.reference-section { margin-top: 16px; }
.reference-section h3, .reference-field legend { font-size: 13px; font-weight: 700; }
.reference-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; margin-top: 8px; }
.reference-grid:empty { display: none; }
.reference-tile { position: relative; min-width: 0; }
.reference-tile img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #f2f3f8; border: 1px solid var(--line); border-radius: 7px; }
.reference-tile .icon { position: absolute; right: 3px; top: 3px; width: 24px; height: 24px; background: #fff; color: var(--ink); }
.reference-field { min-width: 0; border: 1px solid var(--line); border-radius: 8px; margin: 0; padding: 8px 10px 10px; }
.reference-field legend span, .reference-field small { color: var(--muted); font-weight: 400; font-size: 11px; }
.editor .reference-picker { position: relative; display: inline-block; margin: 7px 6px 3px 0; padding: 6px 8px; border: 1px dashed #bdb6f2; border-radius: 6px; color: var(--violet-dark); cursor: pointer; }
.reference-picker:focus-within { outline: 2px solid var(--violet); }
.reference-picker input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.editor { width: min(560px, calc(100vw - 30px)); }
.editor.compact { width: min(400px, calc(100vw - 30px)); }
.editor form { display: grid; gap: 13px; padding: 23px; }
.editor form > p { font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.editor label { display: block; font-size: 12px; font-weight: 700; }
.editor label span:not(.upload-icon) { font-weight: 400; color: var(--muted); }
.editor input:not([type=file]), .editor select, .editor textarea { display: block; width: 100%; min-width: 0; border: 1px solid #dedfee; background: #fff; color: var(--ink); border-radius: 7px; margin-top: 5px; padding: 8px 9px; font-size: 13px; font-weight: 400; }
.editor textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.editor .dropzone { position: relative; display: grid; gap: 4px; justify-items: center; text-align: center; cursor: pointer; padding: 13px; border: 1px dashed #bdb6f2; border-radius: 9px; background: #faf9ff; color: #4d46ad; overflow-wrap: anywhere; }
.dropzone:hover, .dropzone.dragover, .dropzone:focus-within { background: #eeebff; }
.dropzone input { position: absolute; width: 100%; height: 100%; inset: 0; opacity: 0; cursor: pointer; }
.dropzone small { color: var(--muted); font-weight: 400; font-size: 10px; }
.upload-icon { display: grid; place-items: center; width: 26px; height: 26px; background: #ece8ff; border-radius: 7px; font-size: 17px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 7px; }
.error { color: #a82742; font-size: 12px; }
.error:empty { display: none; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); padding: 10px 15px; border-radius: 8px; color: #fff; background: #252344; font-size: 12px; z-index: 10; }
.gate { display: grid; min-height: 100dvh; place-items: center; padding: 15px; color: var(--muted); }
@media (min-width: 1550px) { .gallery { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1130px) { .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 875px) { .shell { grid-template-columns: 178px minmax(0, 1fr); } .masthead, .content { padding-left: 16px; padding-right: 16px; } .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } .breadcrumb { display: none; } .header-actions { flex: 1; } .search { flex: 1; width: auto; } }
@media (max-width: 590px) {
  .shell { display: block; } .sidebar { position: static; height: auto; border: 0; padding: 12px; }
  .brand { padding: 0 0 10px; } .brand .logo { width: 31px; height: 31px; flex-basis: 31px; }
  #views, .categories { display: flex; gap: 5px; overflow-x: auto; }
  .nav-item { width: auto; flex: 0 0 auto; min-height: 33px; white-space: nowrap; }
  .category-row { flex: 0 0 auto; } .category-more { bottom: 2px; }
  .sidebar-section { margin-top: 8px; padding-top: 5px; }
  .sidebar-title { padding-bottom: 2px; } .sidebar-footer { margin-top: 8px; padding-top: 5px; }
  .masthead { min-height: auto; padding: 9px 12px; }
  .content { padding: 20px 12px; } .intro { margin-bottom: 15px; } .results { gap: 4px; }
  .gallery { column-gap: 9px; } .card-body { padding: 9px; }
  .detail[open] { display: block; } .detail-media { min-height: 120px; } .detail-media img, .detail-media video { max-height: 37dvh; }
  .detail-info { padding: 15px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
