:root {
  color-scheme: dark;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #eaf2fb;
  background: #07111f;
  --bg: #07111f;
  --surface: #0c1b2c;
  --surface-2: #10243a;
  --line: #223a53;
  --muted: #8da3ba;
  --accent: #4595f7;
  --accent-soft: #132f4e;
  --danger: #f08b99;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 300px; background: var(--bg); }
body { min-height: 100vh; margin: 0; background: var(--bg); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid #78b7ff; outline-offset: 2px; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 9px 12px; border-radius: 7px; background: white; color: #07111f; transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.site-header { position: sticky; z-index: 20; top: 0; border-bottom: 1px solid #20364d; background: rgba(7,17,31,.94); backdrop-filter: blur(14px); }
.header-inner { width: min(1380px, calc(100% - 40px)); min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 28px; margin: auto; }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand img { border-radius: 10px; box-shadow: 0 7px 20px rgba(0,0,0,.25); }
.brand span { display: flex; flex-direction: column; line-height: 1; }
.brand strong { font-size: 17px; }
.brand small { margin-top: 6px; color: #71879d; font-size: 8px; font-weight: 700; letter-spacing: .12em; }
.primary-nav { align-self: stretch; display: flex; align-items: stretch; gap: 6px; }
.primary-nav a { min-width: 74px; display: grid; place-items: center; padding: 0 16px; border-bottom: 2px solid transparent; color: #91a6bb; font-size: 14px; text-decoration: none; }
.primary-nav a:hover { color: white; }
.primary-nav a.active { border-bottom-color: var(--accent); color: white; }

.shell { width: min(1380px, calc(100% - 40px)); margin: auto; }
.page-heading { min-height: 150px; display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 34px 0 26px; }
.eyebrow { color: #65a7ff; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.page-heading h1 { margin: 0 0 7px; font-size: clamp(28px, 3vw, 40px); letter-spacing: -.03em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.button { min-height: 42px; padding: 0 17px; border: 1px solid var(--line); border-radius: 9px; color: #c9d7e6; background: var(--surface); cursor: pointer; }
.button.primary { border-color: #4b9eff; background: var(--accent); color: white; font-weight: 700; }
.button.secondary { background: transparent; }
.button.compact { min-height: 36px; padding: 0 13px; font-size: 12px; }
.button:disabled { cursor: wait; opacity: .65; }

.toolbar { display: grid; grid-template-columns: minmax(280px, 430px) minmax(0, 1fr); align-items: end; gap: 22px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.search-form > label { display: block; margin: 0 0 8px; color: #9eb1c4; font-size: 11px; }
.search-form > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.search-form input { width: 100%; height: 42px; padding: 0 13px; border: 1px solid #2a4968; border-right: 0; border-radius: 8px 0 0 8px; background: #081624; color: white; }
.search-form button { min-width: 66px; border: 1px solid #347dcc; border-radius: 0 8px 8px 0; background: #256dbb; color: white; cursor: pointer; }
.category-filter { display: flex; flex-wrap: wrap; gap: 7px; }
.category-filter button { min-height: 34px; padding: 0 13px; border: 1px solid #263f59; border-radius: 99px; background: #0a1725; color: #8fa5ba; font-size: 11px; cursor: pointer; }
.category-filter button:hover { color: white; }
.category-filter button.active { border-color: #3e86d6; background: var(--accent-soft); color: #9fcaff; }
.toolbar-filters { display: grid; gap: 10px; }
.filter-group { display: grid; grid-template-columns: 68px minmax(0,1fr); align-items: center; gap: 9px; }
.filter-group > span { color: #8399ae; font-size: 10px; }

.resource-section { padding: 4px 0 60px; }
.resource-summary { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; list-style: none; }
.resource-summary::-webkit-details-marker { display: none; }
.resource-summary h2 { margin: 0; font-size: 17px; }
.resource-summary p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.resource-summary::after { content: "展开"; min-width: 58px; padding: 7px 10px; border: 1px solid #315574; border-radius: 8px; color: #83bafd; font-size: 10px; text-align: center; }
.resource-section[open] .resource-summary::after { content: "收起"; }
.resource-summary:hover { border-color: #365e85; }
.resource-summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.resource-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); align-items: stretch; gap: 12px; margin-top: 14px; }
.resource-card { min-width: 0; min-height: 210px; display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.resource-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.resource-card h3 { margin: 0; font-size: 15px; line-height: 1.4; }
.resource-card > p { flex: 1; margin: 0; color: #91a5ba; font-size: 11px; line-height: 1.7; }
.resource-license { flex: none; padding: 4px 7px; border-radius: 99px; background: #173a31; color: #71d2a6; font-size: 9px; }
.resource-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.resource-tags span { padding: 4px 7px; border-radius: 6px; background: #132e4a; color: #83bafd; font-size: 9px; }
.resource-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 2px; }
.resource-actions a { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 0 11px; border: 1px solid #2a4968; border-radius: 7px; color: #a9bbce; font-size: 10px; text-decoration: none; }
.resource-actions a:hover { border-color: #4b83b9; color: white; }
.resource-actions .resource-primary { border-color: #347dcc; background: #256dbb; color: white; }

.gallery-section { padding: 25px 0 42px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.section-heading h2 { margin: 0; font-size: 19px; }
.section-heading p { margin: 0; color: #748ba2; font-size: 11px; }
.prompt-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.prompt-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); transition: border-color .15s, transform .15s; }
.prompt-card:hover { border-color: #365e85; transform: translateY(-2px); }
.card-open { width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.card-media { position: relative; height: 205px; overflow: hidden; background: #07111b; }
.card-media img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .25s; }
.prompt-card:hover .card-media img { transform: scale(1.02); }
.card-media.prompt-only { display: grid; place-items: center; background: radial-gradient(circle at 25% 25%, #174271, #091724 62%); }
.card-media.prompt-only span { color: #6da7e8; font: 800 10px/1 ui-monospace, Consolas, monospace; letter-spacing: .14em; }
.media-badge { position: absolute; right: 9px; bottom: 9px; padding: 5px 7px; border-radius: 6px; background: rgba(4,12,21,.8); color: #dbe9f7; font-size: 9px; }
.card-copy { min-height: 142px; padding: 14px 15px 13px; }
.category-tag { display: inline-flex; padding: 3px 7px; border-radius: 99px; background: #132e4a; color: #75b3ff; font-size: 9px; }
.card-tags { display: flex; align-items: center; gap: 5px; }
.type-tag { display: inline-flex; padding: 3px 7px; border-radius: 99px; background: #173a31; color: #71d2a6; font-size: 9px; }
.template-pose .type-tag { background: #302a4d; color: #b7a6ff; }
.card-copy h3 { overflow: hidden; margin: 9px 0 7px; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.card-copy > p { height: 40px; display: -webkit-box; overflow: hidden; margin: 0; color: #91a5ba; font: 11px/1.8 ui-monospace, Consolas, monospace; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.card-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; color: #657c92; font-size: 9px; }
.card-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-actions { min-height: 44px; display: flex; align-items: center; gap: 5px; padding: 6px 9px; border-top: 1px solid #1d3349; }
.card-actions button { min-height: 30px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: #8298ad; font-size: 10px; cursor: pointer; }
.card-actions button:hover { background: #12263a; color: white; }
.card-actions .liked { color: #f08b9a; }
.card-actions .copy-prompt { margin-left: auto; color: #81b9ff; }
.card-actions .download-template { margin-left: auto; padding: 8px; border-radius: 6px; color: #a99cff; font-size: 10px; text-decoration: none; }
.card-actions .download-template:hover { background: #17243b; color: white; }
.empty-state { grid-column: 1 / -1; min-height: 180px; display: grid; place-items: center; padding: 30px; border: 1px dashed #29445f; border-radius: 13px; color: var(--muted); font-size: 13px; text-align: center; }

footer { width: min(1380px, calc(100% - 40px)); min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: auto; border-top: 1px solid #172a3e; color: #667d92; font-size: 10px; }
footer a { color: inherit; text-decoration: none; }

dialog { max-height: calc(100dvh - 24px); padding: 0; border: 1px solid #31516e; border-radius: 15px; background: #0c1b2c; color: white; box-shadow: 0 30px 90px rgba(0,0,0,.5); }
dialog::backdrop { background: rgba(1,7,13,.78); backdrop-filter: blur(3px); }
.submit-dialog { width: min(760px, calc(100% - 24px)); overflow: auto; }
.submit-dialog form { padding: 24px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.dialog-header span { color: #63a8ff; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.dialog-header h2 { margin: 6px 0 0; font-size: 23px; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid #29455f; border-radius: 8px; background: #102238; color: #a9bbce; font-size: 21px; cursor: pointer; }
.form-intro { margin: 15px 0 20px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.submit-mode-tabs { display: flex; gap: 4px; margin-top: 18px; padding: 4px; border-radius: 9px; background: #081522; }
.submit-mode-tabs button { flex: 1; min-height: 36px; border: 0; border-radius: 7px; background: transparent; color: #7f96ac; font-size: 10px; cursor: pointer; }
.submit-mode-tabs button.active { background: #1e67b7; color: white; }
.submit-mode-panel { margin-top: 14px; }
.submit-mode-panel .form-intro { margin: 0 0 12px; }
.template-file-field { min-height: 112px; display: grid; place-content: center; gap: 8px; padding: 18px; border: 1px dashed #3c6384; border-radius: 10px; background: #091827; text-align: center; cursor: pointer; }
.template-file-field input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.template-file-field strong { color: #8ec1ff; font-size: 12px; }
.field { display: grid; gap: 7px; }
.field > span, .image-field > span:first-child { color: #a8bacb; font-size: 11px; }
.field em { color: #72b2ff; font-style: normal; }
.field small, .image-field small { color: #6f859b; font-weight: 400; }
.field input, .field textarea, .field select, .comment-form input, .comment-form textarea { width: 100%; border: 1px solid #294760; border-radius: 8px; background: #081522; color: white; outline: 0; }
.field input, .field select, .comment-form input { height: 40px; padding: 0 11px; }
.field textarea, .comment-form textarea { padding: 10px 11px; line-height: 1.6; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 13px; }
.form-grid .full { grid-column: 1 / -1; }
.image-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 16px; }
.image-field { min-height: 100px; display: grid; place-content: center; gap: 9px; padding: 15px; border: 1px dashed #31536f; border-radius: 9px; background: #091725; cursor: pointer; }
.image-field input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-state { overflow: hidden; color: #73b0fb; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.detail-dialog { width: min(1120px, calc(100% - 24px)); display: grid; grid-template-columns: minmax(300px, .9fr) minmax(380px, 1.1fr); overflow: hidden; }
.detail-dialog:not([open]) { display: none; }
.detail-close { position: absolute; z-index: 5; top: 12px; right: 12px; background: rgba(10,25,39,.92); }
.detail-media { min-height: 610px; max-height: calc(100dvh - 26px); display: grid; grid-auto-rows: minmax(0, 1fr); gap: 1px; overflow: auto; background: #040b12; }
.detail-media.empty::after { content: "NO PREVIEW"; display: grid; place-items: center; color: #5d91ca; font: 800 11px/1 ui-monospace,Consolas,monospace; letter-spacing: .14em; background: radial-gradient(circle at 30% 25%,#153d67,#07111b 65%); }
.detail-media figure { min-height: 0; margin: 0; position: relative; }
.detail-media img { width: 100%; height: 100%; min-height: 300px; display: block; object-fit: contain; }
.detail-media figcaption { position: absolute; right: 9px; bottom: 9px; padding: 5px 7px; border-radius: 6px; background: rgba(3,10,17,.8); font-size: 9px; }
.detail-content { max-height: calc(100dvh - 26px); overflow: auto; padding: 26px; }
.detail-meta { display: flex; align-items: center; gap: 8px; padding-right: 40px; color: #788fa5; font-size: 10px; }
.detail-meta #detail-category { padding: 4px 7px; border-radius: 99px; background: #153250; color: #80baff; }
.detail-meta #detail-type { padding: 4px 7px; border-radius: 99px; background: #173a31; color: #7ad7ae; }
.detail-meta time { margin-left: auto; }
.detail-content > h2 { margin: 14px 0 17px; font-size: 24px; }
.prompt-panel { overflow: hidden; border: 1px solid #28465f; border-radius: 10px; background: #081522; }
.prompt-panel > div { min-height: 43px; display: flex; align-items: center; justify-content: space-between; padding: 0 13px; border-bottom: 1px solid #223c54; }
.prompt-panel strong { font-size: 11px; }
.prompt-panel button { border: 0; background: transparent; color: #79b5ff; font-size: 10px; cursor: pointer; }
.prompt-panel pre { max-height: 220px; overflow: auto; margin: 0; padding: 14px; color: #b7c9da; font: 11px/1.75 ui-monospace,Consolas,monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.template-detail-panel { overflow: hidden; border: 1px solid #28465f; border-radius: 10px; background: #081522; }
.template-detail-heading { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 12px; border-bottom: 1px solid #223c54; }
.template-detail-heading strong { font-size: 11px; }
.template-download { display: inline-flex; align-items: center; min-height: 32px; color: #d6e7f8; text-decoration: none; }
.template-record-list { display: grid; gap: 1px; background: #1b3247; }
.template-record { padding: 13px; background: #081522; }
.template-record header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.template-record h3 { margin: 0; font-size: 12px; }
.template-record header button { border: 0; background: transparent; color: #79b5ff; font-size: 10px; cursor: pointer; }
.template-record pre { max-height: 190px; overflow: auto; margin: 11px 0 0; color: #b7c9da; font: 11px/1.7 ui-monospace,Consolas,monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.record-note { display: block; margin-top: 8px; color: #7690a8; font-size: 9px; }
.record-kind { padding: 4px 7px; border-radius: 99px; background: #302a4d; color: #bcadff; font-size: 9px; }
.engagement-row { display: flex; align-items: center; gap: 17px; min-height: 53px; border-bottom: 1px solid #20364b; color: #7f96ac; font-size: 11px; }
.engagement-row button { border: 0; background: transparent; color: #8ba2b8; cursor: pointer; }
.engagement-row button.liked { color: #ef8494; }
.comments h3 { margin: 18px 0 12px; font-size: 15px; }
.comment-list { display: grid; gap: 8px; }
.comments-empty { padding: 16px; border-radius: 8px; background: #091725; color: #768da3; font-size: 10px; text-align: center; }
.comment { padding: 11px 12px; border-radius: 8px; background: #091725; }
.comment header { display: flex; justify-content: space-between; gap: 12px; color: #6e879d; font-size: 9px; }
.comment strong { color: #adc0d2; }
.comment p { margin: 8px 0 0; color: #9fb2c4; font-size: 11px; line-height: 1.6; white-space: pre-wrap; }
.comment-form { display: grid; grid-template-columns: 150px minmax(0,1fr) auto; align-items: end; gap: 8px; margin-top: 10px; }
.comment-form textarea { min-height: 72px; }
.toast { position: fixed; z-index: 80; right: 18px; bottom: 18px; max-width: min(380px, calc(100% - 36px)); padding: 12px 15px; border: 1px solid #2f6850; border-radius: 9px; background: #123126; color: #d3f2e1; font-size: 11px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .18s; }
.toast.error { border-color: #71414b; background: #351d24; color: #f0c5cc; }
.toast.visible { opacity: 1; transform: none; }

.announcement-page { min-height: calc(100vh - 134px); }
.announcement-list { display: grid; gap: 12px; padding-bottom: 55px; }
.announcement-card { padding: 22px 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.announcement-card header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.announcement-card h2 { margin: 0; font-size: 17px; }
.announcement-card time { flex: none; color: #71889e; font-size: 10px; }
.announcement-card p { margin: 13px 0 0; color: #9cafc1; font-size: 12px; line-height: 1.75; white-space: pre-wrap; }

@media (max-width: 1120px) { .prompt-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } .resource-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .toolbar { grid-template-columns: 360px minmax(0,1fr); } }
@media (max-width: 820px) { .prompt-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .toolbar { grid-template-columns: 1fr; gap: 15px; } .detail-dialog { grid-template-columns: 1fr; overflow: auto; } .detail-media { min-height: 280px; max-height: 46vh; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; } .detail-content { max-height: none; overflow: visible; } }
@media (max-width: 600px) { .header-inner,.shell,footer { width: calc(100% - 24px); } .header-inner { min-height: 59px; } .brand img { width: 32px; height: 32px; } .brand strong { font-size: 14px; } .brand small { display: none; } .primary-nav a { min-width: 58px; padding: 0 10px; font-size: 12px; } .page-heading { min-height: 126px; padding: 25px 0 20px; } .page-heading h1 { font-size: 28px; } .page-heading p { font-size: 12px; } .page-heading .button { min-height: 38px; padding: 0 12px; font-size: 11px; } .toolbar { padding: 13px; } .filter-group { grid-template-columns: 1fr; gap: 6px; } .resource-section .section-heading { align-items: flex-start; flex-direction: column; gap: 6px; } .resource-grid,.prompt-grid { grid-template-columns: 1fr; } .card-media { height: min(62vw, 270px); } .card-copy { min-height: 132px; } .form-grid,.image-fields { grid-template-columns: 1fr; } .form-grid .full { grid-column: auto; } .submit-dialog form { padding: 18px; } .comment-form { grid-template-columns: 1fr; } .detail-content { padding: 20px 16px; } .detail-content > h2 { font-size: 20px; } .detail-meta { flex-wrap: wrap; } .detail-meta time { margin-left: 0; } .announcement-card { padding: 18px; } .announcement-card header { align-items:flex-start; flex-direction:column; gap:7px; } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior: auto !important; transition: none !important; } }

/* Theme control */
.header-actions { align-self: stretch; display: flex; align-items: center; gap: 10px; }
.theme-toggle { min-height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: #a9bbce; font-size: 10px; cursor: pointer; white-space: nowrap; }
.theme-toggle [data-theme-icon] { width: 14px; font-size: 14px; line-height: 1; text-align: center; }

:root[data-theme="light"] {
  color-scheme: light;
  color: #172538;
  background: #f3f6fa;
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --line: #d3dde8;
  --muted: #65788d;
  --accent: #2677d9;
  --accent-soft: #e8f2ff;
  --danger: #c6475c;
}
:root[data-theme="light"] button:focus-visible,
:root[data-theme="light"] input:focus-visible,
:root[data-theme="light"] textarea:focus-visible,
:root[data-theme="light"] select:focus-visible,
:root[data-theme="light"] a:focus-visible { outline-color: #1769c7; }
:root[data-theme="light"] .site-header { border-bottom-color: #d9e2ec; background: rgba(255,255,255,.94); }
:root[data-theme="light"] .brand small { color: #6c8095; }
:root[data-theme="light"] .primary-nav a { color: #63778c; }
:root[data-theme="light"] .primary-nav a:hover,
:root[data-theme="light"] .primary-nav a.active { color: #172538; }
:root[data-theme="light"] .theme-toggle,
:root[data-theme="light"] .button { color: #334a61; }
:root[data-theme="light"] .button.primary { color: #fff; }
:root[data-theme="light"] .eyebrow { color: #176dce; }
:root[data-theme="light"] .toolbar { box-shadow: 0 5px 18px rgba(34,59,85,.05); }
:root[data-theme="light"] .search-form > label,
:root[data-theme="light"] .field > span,
:root[data-theme="light"] .image-field > span:first-child { color: #536a80; }
:root[data-theme="light"] .search-form input,
:root[data-theme="light"] .field input,
:root[data-theme="light"] .field textarea,
:root[data-theme="light"] .field select,
:root[data-theme="light"] .comment-form input,
:root[data-theme="light"] .comment-form textarea { border-color: #c7d4e1; background: #fff; color: #172538; }
:root[data-theme="light"] .category-filter button { border-color: #cbd7e3; background: #f7f9fc; color: #5d7287; }
:root[data-theme="light"] .category-filter button:hover { color: #172538; }
:root[data-theme="light"] .category-filter button.active { border-color: #7eafe8; color: #1769c7; }
:root[data-theme="light"] .filter-group > span,
:root[data-theme="light"] .section-heading p { color: #6b7f93; }
:root[data-theme="light"] .resource-card { box-shadow: 0 5px 18px rgba(34,59,85,.05); }
:root[data-theme="light"] .resource-card > p { color: #556b80; }
:root[data-theme="light"] .resource-license { background: #e4f5ed; color: #247b56; }
:root[data-theme="light"] .resource-tags span { background: #e7f2ff; color: #176dce; }
:root[data-theme="light"] .resource-actions a { border-color: #c7d4e1; color: #4d647a; }
:root[data-theme="light"] .resource-actions a:hover { border-color: #7eafe8; color: #1769c7; }
:root[data-theme="light"] .resource-actions .resource-primary { border-color: #2677d9; background: #2677d9; color: white; }
:root[data-theme="light"] .prompt-card { box-shadow: 0 5px 18px rgba(34,59,85,.05); }
:root[data-theme="light"] .prompt-card:hover { border-color: #9db8d2; }
:root[data-theme="light"] .card-media.prompt-only { background: radial-gradient(circle at 25% 25%,#d9ebff,#edf4fb 62%); }
:root[data-theme="light"] .category-tag { background: #e7f2ff; color: #176dce; }
:root[data-theme="light"] .type-tag { background: #e4f5ed; color: #247b56; }
:root[data-theme="light"] .template-pose .type-tag,
:root[data-theme="light"] .record-kind { background: #eeeafd; color: #6753b5; }
:root[data-theme="light"] .card-copy > p { color: #556b80; }
:root[data-theme="light"] .card-meta { color: #718498; }
:root[data-theme="light"] .card-actions { border-top-color: #e0e7ef; }
:root[data-theme="light"] .card-actions button { color: #60758a; }
:root[data-theme="light"] .card-actions button:hover,
:root[data-theme="light"] .card-actions .download-template:hover { background: #eef3f8; color: #172538; }
:root[data-theme="light"] .card-actions .copy-prompt { color: #176dce; }
:root[data-theme="light"] .card-actions .download-template { color: #6753b5; }
:root[data-theme="light"] .empty-state { border-color: #b9c9d8; }
:root[data-theme="light"] footer { border-top-color: #d9e2ec; color: #65798e; }
:root[data-theme="light"] dialog { border-color: #c2d0de; background: #fff; color: #172538; box-shadow: 0 30px 90px rgba(42,57,75,.25); }
:root[data-theme="light"] dialog::backdrop { background: rgba(36,48,62,.5); }
:root[data-theme="light"] .icon-button { border-color: #c7d4e1; background: #f4f7fa; color: #4d647a; }
:root[data-theme="light"] .detail-close { background: rgba(255,255,255,.94); }
:root[data-theme="light"] .submit-mode-tabs { background: #edf2f7; }
:root[data-theme="light"] .submit-mode-tabs button { color: #60758a; }
:root[data-theme="light"] .submit-mode-tabs button.active { color: #fff; }
:root[data-theme="light"] .template-file-field,
:root[data-theme="light"] .image-field { border-color: #aebfd0; background: #f8fafc; }
:root[data-theme="light"] .template-file-field strong,
:root[data-theme="light"] .file-state { color: #176dce; }
:root[data-theme="light"] .detail-media { background: #e8eef4; }
:root[data-theme="light"] .detail-meta { color: #657a8e; }
:root[data-theme="light"] .detail-meta #detail-category { background: #e7f2ff; color: #176dce; }
:root[data-theme="light"] .detail-meta #detail-type { background: #e4f5ed; color: #247b56; }
:root[data-theme="light"] .prompt-panel,
:root[data-theme="light"] .template-detail-panel { border-color: #cbd7e3; background: #f8fafc; }
:root[data-theme="light"] .prompt-panel > div,
:root[data-theme="light"] .template-detail-heading { border-bottom-color: #d9e2ec; }
:root[data-theme="light"] .prompt-panel pre,
:root[data-theme="light"] .template-record pre { color: #334a61; }
:root[data-theme="light"] .template-record-list { background: #d9e2ec; }
:root[data-theme="light"] .template-record { background: #f8fafc; }
:root[data-theme="light"] .engagement-row { border-bottom-color: #d9e2ec; color: #657a8e; }
:root[data-theme="light"] .engagement-row button { color: #60758a; }
:root[data-theme="light"] .comments-empty,
:root[data-theme="light"] .comment { background: #f2f6fa; }
:root[data-theme="light"] .comment header { color: #657a8e; }
:root[data-theme="light"] .comment strong { color: #334a61; }
:root[data-theme="light"] .comment p { color: #455d74; }
:root[data-theme="light"] .announcement-card { box-shadow: 0 5px 18px rgba(34,59,85,.05); }
:root[data-theme="light"] .announcement-card time { color: #657a8e; }
:root[data-theme="light"] .announcement-card p { color: #455d74; }
:root[data-theme="light"] .toast { border-color: #87b9a2; background: #e9f7ef; color: #226043; }
:root[data-theme="light"] .toast.error { border-color: #d8a4ad; background: #fbeef0; color: #8c3041; }

@media (max-width: 600px) {
  .header-actions { gap: 4px; }
  .theme-toggle { width: 34px; padding: 0; justify-content: center; }
  .theme-toggle [data-theme-label] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* 评论区和模板输入输出对照 */
.comment-form { align-items: start; }
.comment-form textarea { height: 42px; min-height: 42px; max-height: 120px; }
.card-actions button.like-button.liked,
.engagement-row button.liked,
:root[data-theme="light"] .card-actions button.like-button.liked,
:root[data-theme="light"] .engagement-row button.liked { color: #e53950; }
.template-file-field.drag-over, .image-field.drag-over,
:root[data-theme="light"] .template-file-field.drag-over,
:root[data-theme="light"] .image-field.drag-over { border-color: #2685ec; background: rgba(38,133,236,.12); }
.detail-media .image-pair { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 8px; }
.detail-media .image-pair > figure:only-child { grid-column: 1 / -1; }
.detail-media .image-pair img { min-height: 0; height: auto; max-height: 65dvh; object-fit: contain; }
.image-arrow { font-size: 26px; color: #2685ec; }
.card-tags, .card-actions { flex-wrap: wrap; }
.card-media.card-image-pair { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 6px; padding: 8px; }
.card-image-pair figure { margin: 0; min-width: 0; }
.card-media.card-image-pair img { width: 100%; height: 160px; object-fit: contain; }
.card-image-pair figcaption { text-align: center; font-size: 12px; }
.template-record header { flex-wrap: wrap; }
.template-record header h3 { flex: 1 1 120px; }
.detail-media figure.selected-preview { outline: 2px solid #2685ec; outline-offset: -2px; }
/* 通知进入顶层，避免被模态弹窗遮挡。 */
.toast { inset: 16px 16px auto auto; margin: 0; width: max-content; max-width: min(440px, calc(100vw - 32px)); height: auto; box-sizing: border-box; overflow-wrap: anywhere; font-size: 14px; }
.toast::backdrop { background: transparent; pointer-events: none; }

/* 每个模板独立一行，图片与提示词共享边框和滚动区域。 */
.detail-dialog { width: min(1400px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); grid-template-columns: minmax(0, 1fr); overflow: auto; overscroll-behavior: contain; }
.detail-dialog .detail-content { min-width: 0; max-height: none; overflow: visible; padding: 24px; }
.detail-dialog .template-detail-panel { border: 0; background: transparent; overflow: visible; }
.detail-dialog .template-detail-heading { border: 0; padding: 0 0 12px; }
.detail-dialog .template-record-list { gap: 16px; background: transparent; }
.detail-dialog .template-record { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; padding: 16px; border: 1px solid #294760; border-radius: 12px; align-items: start; }
.detail-dialog .template-record.without-images { grid-template-columns: minmax(0, 1fr); }
.record-images { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 10px; align-items: center; min-width: 0; }
.record-images figure { margin: 0; min-width: 0; }
.record-images figure:only-child { grid-column: 1 / -1; }
.record-images img { display: block; width: 100%; height: 300px; object-fit: contain; border-radius: 8px; }
.record-images figcaption { text-align: center; margin-top: 8px; font-size: 12px; color: #819ab2; }
.record-content { min-width: 0; }
.detail-dialog .template-record pre { max-height: none; overflow: visible; font: inherit; font-size: 14px; line-height: 1.7; }
.detail-dialog .template-record h3 { font-size: 16px; }
:root[data-theme="light"] .detail-dialog .template-record { border-color: #c7d4e1; }
html:has(dialog[open]), body:has(dialog[open]) { overflow: hidden; }
@media(max-width: 820px) {
  .detail-dialog .template-record { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .detail-dialog .detail-content { padding: 18px 12px; }
  .record-images img { height: 230px; }
}
@media(max-width: 820px) {
  .detail-dialog .template-record { grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); gap: 10px; padding: 10px; }
  .record-images { gap: 4px; }
  .record-images img { height: clamp(80px, 24vw, 220px); }
  .record-images .image-arrow { font-size: 18px; }
  .record-images figcaption { font-size: 11px; }
}
.record-images img { cursor: zoom-in; }
.community-image-viewer { width: min(96vw, 1600px); max-width: 96vw; height: 94dvh; max-height: 94dvh; padding: 16px; box-sizing: border-box; overflow: auto; }
.community-image-viewer > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.community-image-viewer > button { position: absolute; right: 12px; top: 12px; z-index: 1; }

.animation-description,.animation-file {padding:12px 16px;white-space:pre-wrap;overflow-wrap:anywhere;}
.submit-mode-tabs {flex-wrap:wrap;}

.template-record-list > figure {margin:0;padding:16px;text-align:center;}
.template-record-list > figure img {max-width:100%;max-height:360px;object-fit:contain;cursor:zoom-in;}
