.ai-studio { max-width: 1000px; margin: 24px auto 100px; padding: 0 16px; color: inherit; }
.ai-studio [hidden] { display: none !important; }
.ai-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ai-studio h1 { font-size: 1.8rem; font-weight: 700; margin: 0; }
.ai-heading h1 i { color: #b56aff; }
.ai-studio button, .ai-studio .ai-action { border: 0; padding: .65em 1.1em; border-radius: 9px; background: #283146; color: #fff; cursor: pointer; }
.ai-studio button:focus-visible, .ai-studio a:focus-visible { outline: 2px solid #b875ff; outline-offset: 3px; }
.ai-studio button:disabled { opacity: .55; cursor: wait; }
.ai-studio button[aria-pressed=true], .ai-studio #ai-submit { background: #883ee5; color: #fff; }
.ai-studio #ai-works-tab { border: 1px solid #6c7487; background: transparent; white-space: nowrap; }
.ai-studio #ai-works-tab[aria-pressed=true] { border-color: #b875ff; color: #ca9cff; }
.ai-studio #ai-create-tab { margin-top: 16px; }
.ai-studio #ai-categories { display: flex; gap: 10px; overflow-x: auto; padding: 5px 2px 14px; margin: 14px 0 8px; scrollbar-width: thin; }
.ai-studio #ai-categories button { flex: 0 0 auto; white-space: nowrap; background: #242b3e; }
.ai-studio #ai-categories button[aria-pressed=true] { background: #883ee5; }
.ai-studio #ai-msg:empty, .ai-studio #ai-form-msg:empty { display: none; }
.ai-studio #ai-msg, .ai-studio #ai-form-msg { margin: 14px 0; line-height: 1.6; }
.ai-template-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.ai-studio .ai-template-card { border-radius: 14px; background: #192133; color: #f2f4fc; overflow: hidden; min-width: 0; }
.ai-card-media { position: relative; }
.ai-studio .ai-template-cover { display: block; position: relative; width: 100%; aspect-ratio: 3 / 4; padding: 0; border-radius: 0; background: #252d40; overflow: hidden; }
.ai-template-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ai-cover-missing::before { content: '暂无演示图'; color: #bbc2d3; position: absolute; inset: 45% 0 auto; text-align: center; }
.ai-demo-badge, .ai-type-badge { position: absolute; background: #090d17a8; color: white; padding: 4px 8px; border-radius: 6px; font-size: .85rem; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-demo-badge { top: 10px; right: 10px; }
.ai-type-badge { bottom: 10px; left: 10px; }
.ai-studio .ai-demo-button { position: absolute; bottom: 10px; right: 10px; padding: 4px 8px; background: #090d17a8; font-size: .85rem; }
.ai-card-media.has-demo .ai-type-badge { max-width: calc(100% - 100px); }
.ai-studio .ai-template-caption { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 8px; text-align: left; border-radius: 0; background: transparent; width: 100%; padding: 14px; }
.ai-template-caption strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ai-template-caption small { grid-column: 1; color: #adb8ce; font-size: .8rem; }
.ai-template-caption span { grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: 24px; }
.ai-dialog { width: min(580px,calc(100% - 24px)); max-height: 88vh; max-height: 88dvh; overflow-y: auto; background: #182135; color: #edf0fa; border: 1px solid #485269; border-radius: 14px; padding: 20px; }
.ai-dialog::backdrop { background: #050710b8; }
.ai-dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.ai-dialog h2 { font-size: 1.2rem; font-weight: 600; }
.ai-studio .ai-dialog-heading button { padding: 4px 12px; font-size: 24px; background: transparent; }
.ai-studio label { display: grid; gap: 5px; margin: 8px 0 14px; font-weight: 600; }
.ai-studio input, .ai-studio select, .ai-studio textarea { display: block; width: 100%; max-width: 100%; border: 1px solid #75819a; border-radius: 8px; padding: .65rem; background: #172033; color: #f3f4f6; color-scheme: dark; }
.ai-studio #ai-cover { width: 100%; max-height: 200px; object-fit: contain; border-radius: 10px; }
.ai-studio #ai-submit { width: 100%; margin-top: 8px; }
.ai-studio #ai-demo-content video, .ai-studio #ai-demo-content img { max-width: 100%; width: 100%; max-height: 65vh; max-height: 65dvh; object-fit: contain; border-radius: 8px; }
.ai-studio #ai-list article { border: 1px solid #63718b59; border-radius: 14px; padding: 18px; margin-bottom: 12px; }
.ai-studio #ai-list h2 { font-size: 1.05rem; font-weight: 650; }
.ai-studio #ai-list p { margin: 8px 0; }
.ai-studio .ai-action { display: inline-block; margin: 4px 8px 0 0; }
.ai-studio #ai-list video, .ai-studio #ai-list img { max-width: 100%; max-height: 420px; background: #101622; border-radius: 8px; display: block; margin: 8px 0; }
.ai-studio #ai-pages { display: flex; gap: 8px; }
.ai-bottom-nav { display: none; }
@media (max-width: 767px) {
 .ai-studio { padding: 0 10px; margin-top: 18px; }
 .ai-template-grid { gap: 12px; }
 .ai-studio .ai-template-caption { padding: 10px; }
 .ai-studio .ai-template-caption strong { font-size: .92rem; }
 .ai-studio .ai-bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: #111728f5; border-top: 1px solid #343b51; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
 .ai-bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; color: #adb6c9; font-size: 12px; text-decoration: none; }
 .ai-bottom-nav i { font-size: 23px; line-height: 1.2; }
 .ai-bottom-nav a[aria-current] { color: #b56aff; }
}

.ai-dialog:not([open]) { display: none; }
.ai-dialog-fallback[open] { position: fixed; top: 5vh; left: 50%; transform: translateX(-50%); margin: 0; z-index: 1000; box-shadow: 0 0 0 100vmax #050710b8; }
