.works-title {
    margin: 0 0 20px;
}

.works-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px 24px;
    min-width: 0;
    margin: 0 0 20px;
}

.works-heading .works-title {
    margin: 0;
}

.works-view-switch {
    display: flex;
    align-items: center;
    gap: 16px;
    width: fit-content;
    margin: 0;
}

.works-view-switch-item {
    position: relative;
    padding: 4px 0 6px;
    border: 0;
    background: transparent;
    color: var(--st-text-muted);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
}

.works-view-switch-item:hover,
.works-view-switch-item:focus-visible {
    color: var(--st-accent);
}

.works-view-switch-item:focus-visible {
    outline: 2px solid var(--st-accent);
    outline-offset: 2px;
}

.works-view-switch-item.is-current {
    color: var(--st-accent);
}

.works-view-switch-item.is-current::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    border-radius: 1px;
    background: var(--st-accent);
}

.works-mine-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
}

.works-mine-filter {
    width: 13rem;
    min-width: 0;
}

.works-mine-filter-keyword {
    flex: 1 1 16rem;
    width: auto;
}

.works-mine-filter-action {
    width: auto;
}

.works-mine-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius-md);
    background: var(--st-surface);
    box-shadow: var(--st-shadow-card);
}

.works-mine-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
    color: var(--st-text);
}

.works-mine-table th {
    padding: 12px 20px;
    font-weight: 600;
    color: var(--st-text-ghost);
    background: color-mix(in srgb, var(--st-text) 3%, var(--st-surface));
    border-bottom: 1px solid var(--st-border);
    white-space: nowrap;
}

.works-mine-table td {
    padding: 16px 20px;
    vertical-align: middle;
    border-bottom: 1px solid var(--st-border);
}

.works-mine-table tbody tr:last-child td {
    border-bottom: 0;
}

.works-mine-row {
    background: transparent;
    transition: background-color var(--st-duration) ease;
}

.works-mine-row:hover {
    background: var(--st-menu-hover-bg);
}

.works-mine-name {
    font-weight: 600;
}

.works-mine-time {
    white-space: nowrap;
    color: var(--st-text-muted);
}

.works-mine-reason {
    max-width: 16rem;
    color: var(--st-text-muted);
    word-break: break-word;
}

.works-mine-status {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border: 1px solid var(--st-border-strong);
    border-radius: var(--st-radius-pill);
    background: color-mix(in srgb, var(--st-text) 4%, var(--st-surface));
    color: var(--st-text-muted);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.works-mine-status.is-published {
    background: color-mix(in srgb, var(--st-ok) 12%, var(--st-surface));
    border-color: color-mix(in srgb, var(--st-ok) 28%, transparent);
    color: var(--st-ok);
}

.works-mine-status.is-blocked {
    background: color-mix(in srgb, var(--st-danger) 12%, var(--st-surface));
    border-color: color-mix(in srgb, var(--st-danger) 28%, transparent);
    color: var(--st-danger);
}

.works-mine-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.works-mine-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
}

.works-mine-action.is-edit {
    color: var(--st-accent);
}

.works-mine-action.is-edit:hover,
.works-mine-action.is-edit:focus-visible {
    color: var(--st-accent-hover);
}

.works-mine-action.is-delete {
    color: var(--st-danger);
}

.works-mine-action.is-delete:hover,
.works-mine-action.is-delete:focus-visible {
    color: color-mix(in srgb, var(--st-danger) 80%, var(--st-text));
}

.works-mine-action:focus-visible {
    outline: 2px solid var(--st-accent);
    outline-offset: 2px;
}

.works-mine-empty {
    padding: 48px 20px;
    color: var(--st-text-muted);
    font-size: 14px;
    text-align: center;
}

.works-mine-thumb-btn {
    position: relative;
    display: inline-flex;
    width: 5.25rem;
    height: 5.25rem;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--st-border);
    border-radius: 8px;
    background: var(--st-elevated);
    cursor: pointer;
    line-height: 0;
}

.works-mine-thumb-btn:hover .works-mine-thumb {
    opacity: 0.85;
}

.works-mine-thumb-btn:focus-visible {
    outline: 2px solid var(--st-accent);
    outline-offset: 2px;
}

.works-mine-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #111;
    transition: opacity 200ms ease;
}

.works-mine-thumb-audio {
    background: var(--st-track);
}

.works-mine-thumb-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.works-mine-thumb-play-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.26);
}

.works-mine-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 16px;
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius-md);
    background: var(--st-surface);
    box-shadow: var(--st-shadow-card);
}

.works-mine-count {
    font-size: 14px;
    color: var(--st-text-muted);
}

@media (max-width: 767px) {
    .works-mine-filter,
    .works-mine-filter-action {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .works-mine-thumb {
        transition: none;
    }
}

#works-publish-modal [role="dialog"] {
    max-height: min(80vh, 860px);
}

#works-publish-modal [data-ui-modal-body] {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.works-publish-form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.works-publish-sheet {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
    min-height: 0;
}

.works-publish-preview {
    position: relative;
    align-self: start;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 16px;
    background:
        radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--st-accent) 16%, transparent), transparent 58%),
        var(--st-track);
}

.works-publish-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.works-publish-main {
    display: grid;
    gap: 4px;
    align-content: start;
    min-width: 0;
    min-height: 0;
    overflow: auto;
}

.works-publish-fields {
    display: grid;
    gap: 8px;
}

@media (max-width: 767px) {
    .works-publish-sheet {
        grid-template-columns: 1fr;
    }

    .works-publish-preview {
        aspect-ratio: 16 / 9;
        max-height: 180px;
    }
}

.works-publish-field {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    column-gap: 10px;
    row-gap: 8px;
    align-items: start;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--st-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--st-elevated) 72%, transparent);
    color: var(--st-text);
    font-size: 14px;
    line-height: 1.45;
    cursor: pointer;
}

.works-publish-field input {
    margin: 3px 0 0;
}

.works-publish-field-label {
    font-weight: 600;
}

.works-publish-field-body {
    grid-column: 2;
    min-width: 0;
    color: var(--st-text-muted);
    overflow-wrap: anywhere;
}

.works-publish-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.works-publish-thumb-btn {
    display: block;
    padding: 3px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
}

.works-publish-thumb-btn:hover .works-publish-thumb,
.works-publish-thumb-btn:focus-visible .works-publish-thumb {
    box-shadow: 0 0 0 2px var(--st-accent, #ec4899);
}

.works-publish-thumb {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    background: #111;
}

.works-publish-audio-btn {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--st-accent, #ec4899);
    font-size: inherit;
    line-height: inherit;
    cursor: pointer;
}

.works-publish-audio-btn:hover,
.works-publish-audio-btn:focus-visible {
    text-decoration: underline;
}

.works-detail-field .works-publish-thumbs {
    margin-top: 4px;
}

.works-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.works-category {
    border: 1px solid var(--st-border, #e5e7eb);
    border-radius: 999px;
    padding: 6px 12px;
    color: inherit;
    text-decoration: none;
}

.works-category.is-active {
    background: var(--st-accent, #111827);
    color: var(--st-text-on-accent, #fff);
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.works-card {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.works-card-media {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px;
    background: var(--st-surface-muted, #f3f4f6);
}

.works-card-media.is-previewing .works-card-thumb {
    opacity: 0;
}

.works-card-thumb,
.works-card-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.works-card-audio,
.works-publish-audio-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--st-text-muted);
    font-size: 14px;
    background:
        radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--st-accent) 16%, transparent), transparent 58%),
        var(--st-track);
}

.works-card-audio-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    color: var(--st-accent);
    background: var(--st-accent-soft, color-mix(in srgb, var(--st-accent) 18%, var(--st-elevated)));
    box-shadow: var(--st-shadow-card, 0 8px 18px color-mix(in srgb, var(--st-accent) 18%, transparent));
    font-size: 22px;
}

.works-card-preview {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.works-card-body {
    padding: 8px 2px 0;
}

.works-card-name {
    font-weight: 600;
}

.works-card-author,
.works-grid-status {
    color: var(--st-text-muted, #6b7280);
}

.works-grid-status {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 280px);
    margin: 0;
}

.works-grid-status[hidden] {
    display: none;
}

.works-pagination {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.works-detail-field dt {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--st-text-muted, #6b7280);
}

.works-detail-field dd {
    margin: 0;
    color: var(--st-text);
    font-size: 15px;
    line-height: 1.7;
    white-space: pre-wrap;
}

#works-viewer-modal [role="dialog"] {
    height: 72vh;
    max-height: calc(100vh - 2rem);
}

#works-viewer-modal [data-ui-modal-body] {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.works-viewer-sheet {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: auto minmax(220px, 1fr);
    grid-template-rows: auto;
    align-content: center;
    align-items: stretch;
    gap: 24px;
    height: 100%;
    max-height: 100%;
    min-height: 0;
}

.works-viewer-stage {
    position: relative;
    display: grid;
    place-items: center;
    width: max-content;
    max-width: 100%;
    max-height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.works-viewer-frame {
    position: relative;
    max-width: 100%;
    max-height: 100%;
}

.works-viewer-sheet.is-audio .works-viewer-stage {
    width: 22rem;
    max-width: 100%;
}

.works-viewer-audio-panel {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    padding: 28px 24px 24px;
    border-radius: 20px;
    background: var(--st-elevated, #fff);
    box-shadow: var(--st-shadow-card, 0 8px 24px rgba(15, 23, 42, 0.06));
}

.works-viewer-stage .preview-audio-note {
    width: 120px;
    height: 120px;
}

.works-viewer-stage .preview-audio-note .ui-svg-icon {
    width: 56px;
    height: 56px;
}

.works-viewer-download {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
}

.works-viewer-download[hidden],
.works-viewer-frame[hidden],
.works-viewer-audio-panel[hidden] {
    display: none;
}

.works-viewer-image.is-previewable {
    cursor: pointer;
}

.works-viewer-image,
.works-viewer-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

.works-viewer-image[hidden],
.works-viewer-video[hidden],
.works-viewer-description[hidden] {
    display: none;
}

.works-viewer-info {
    min-width: 0;
    min-height: 0;
    max-height: 100%;
    overflow: auto;
}

.works-viewer-meta {
    margin: 0 0 12px;
    color: var(--st-text-muted, #a1a1aa);
    font-size: 14px;
}

.works-viewer-description {
    margin: 0 0 16px;
    color: var(--st-text);
    font-size: 15px;
    line-height: 1.7;
    white-space: pre-wrap;
}

.works-viewer-fields {
    display: grid;
    gap: 24px;
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid var(--st-border);
}

.works-viewer-fields .works-detail-field dt {
    margin-bottom: 12px;
}

.works-viewer-fields:empty {
    display: none;
}

@media (max-width: 767px) {
    #works-viewer-modal [role="dialog"] {
        height: calc(100vh - 2rem);
        max-height: calc(100vh - 2rem);
    }

    .works-viewer-sheet {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) minmax(0, 38%);
        align-content: stretch;
        gap: 16px;
    }

    .works-viewer-stage {
        width: 100%;
        height: 100%;
        max-width: none;
    }
}
