/* ページ全体の背景＆フォント */
body {
    background: linear-gradient(135deg, #d3e0ea 0%, #f7f9fc 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #222;
    margin: 0;
    padding: 0;
}

h1 {
    text-align: center;
    margin: 24px 0;
    font-weight: 700;
    color: #2c3e50;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* 画像コンテナはグリッドで整列 */
.img-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    /* 中央寄せ */
}

.img-item {
    flex: 0 1 200px;
    /* 幅200pxで折り返し可能 */
}


/* 個別の画像カード */
.img-item {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.35s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    text-align: center;
}

.img-item:hover {
    transform: translateY(-8px) scale(1.07);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.img-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.img-item p {
    margin-top: 12px;
    font-size: 1rem;
    color: #444;
    font-weight: 600;
    user-select: none;
    letter-spacing: 0.02em;
}

/* タグ表示 */
.item-tags {
    margin-top: 4px;
    text-align: center;
}

/* スマホレスポンシブ */
@media (max-width: 600px) {
    .img-container {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
        padding: 12px;
    }

    .img-item {
        padding: 8px;
    }

    .img-item p {
        font-size: 0.85rem;
    }
}

/* モーダル */
#modal,
#model-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

#modal-content {
    position: relative;
    margin: 5% auto;
    padding: 20px;
    background-color: white;
    max-width: 90%;
    max-height: 90vh;
    text-align: center;
    border-radius: 10px;
    overflow: auto;
}

#modal-img {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    margin: 0 auto;
}

#modal-close {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: #eee;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    color: #f00;
    position: static;
}

/* 検索バー */
#searchInput {
    margin-bottom: 15px;
    padding: 8px;
    width: 100%;
    max-width: 400px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

/* セレクトボックス */
select[name="img-type"] {
    padding: 8px 12px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: white;
    color: #333;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

select[name="img-type"]:hover {
    border-color: #2196f3;
    box-shadow: 0 0 6px rgba(33, 150, 243, 0.4);
}

select[name="img-type"]:focus {
    border-color: #1976d2;
    box-shadow: 0 0 8px rgba(25, 118, 210, 0.5);
}

select[name="img-type"] option {
    padding: 6px;
}

/* ボタン類 */
button,
#download-btn,
input[type="button"],
#copy-btn {
    padding: 8px 14px;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

button:hover {
    background-color: #1976d2;
}

#download-btn {
    background-color: #4caf50;
    color: white;
    text-decoration: none;
    text-align: center;
}

#download-btn:hover {
    background-color: #45a049;
}

#copy-btn {
    margin-top: 10px;
    font-size: 14px;
    padding: 8px 16px;
}

/* モデルビューア関連 */
.model-item {
    display: inline-block;
    margin: 10px;
    text-align: center;
}

model-viewer {
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* h1内の画像 */
h1 img {
    width: 50px;
    height: 50px;
    vertical-align: middle;
    margin-right: 10px;
}

/* 検索＆セレクト配置 */
#searchContainer {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    text-align: center;
    margin: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0);
}

/* フッター */
footer {
    background-color: #f0f0f3;
    color: #555;
    text-align: center;
    padding: 20px 10px;
    font-size: 0.9rem;
    line-height: 1.6;
    border-top: 2px solid #ccc;
}

footer a {
    color: #2196f3;
    text-decoration: none;
    margin: 0 6px;
    transition: color 0.3s;
}

footer a:hover {
    color: #1976d2;
    text-decoration: underline;
}

/* タグリンクスタイル */
.modal-tag {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 6px;
    padding: 2px 10px;
    margin: 2px 2px 2px 0;
    text-decoration: none;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.modal-tag:hover {
    background: #1976d2;
    color: #fff;
}