body {
    font-family: sans-serif;
    background-color: #f0f0f0;
    color: #333;
    margin: 0;
    padding: 20px;
}

header {
    background-color: #ddd;
    padding: 10px 20px;
    border: 1px solid #ccc;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    margin: 0;
    font-size: 24px;
}

.view-switch button {
    padding: 5px 10px;
    border: 1px solid #999;
    background-color: #eee;
    cursor: pointer;
}

.view-switch button:hover {
    background-color: #fff;
}

#gallery-container.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

#gallery-container.list-view {
    display: block;
}

.gallery-item {
    border: 1px solid #ccc;
    background-color: #fff;
    padding: 10px;
}

#gallery-container.grid-view .gallery-item {
    text-align: center;
}

#gallery-container.list-view .gallery-item {
    margin-bottom: 10px;
}

.gallery-item img {
    max-width: 100%;
    height: auto;
    display: block;
}

#gallery-container.grid-view .gallery-item img {
    margin-bottom: 10px;
}

#gallery-container.list-view .list-view-content img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    margin-right: 15px;
}

.gallery-item p {
    margin: 0;
    font-size: 14px;
    word-break: break-all;
}

/* 表示モードごとのコンテンツ表示切り替え */
.grid-view .list-view-content,
.list-view .grid-view-content {
    display: none;
}

.list-view .list-view-content {
    display: flex;
    align-items: center;
}

.grid-view .grid-view-content {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* リスト表示の詳細スタイル */
.list-details {
    display: flex;
    flex-direction: column;
}

.list-details .filename {
    font-weight: bold;
    margin-bottom: 5px;
}

.list-details .meta {
    font-size: 12px;
    color: #666;
}

.list-details .meta span {
    margin-right: 10px;
}
