body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    display: flex;
    height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

#sidebar {
    width: 280px;
    padding: 1rem;
    box-sizing: border-box;
    background-color: #f8f8f8;
    overflow-y: auto;
    border-right: 1px solid #ddd;
    transition: transform 0.3s;
    transform: translateX(0);
    position: relative; /* 必要なら relative を明示 */
    z-index: 20; /* メイン領域より高く */
}

@media (max-width: 768px) {
    #sidebar {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        z-index: 20; /* デスクトップと合わせて手前に */
        transform: translateX(0);
    }

    #sidebar.-translate-x-full {
        transform: translateX(-100%);
    }
}

#main {
    flex-grow: 1;
    position: relative;
    background-color: #fff;
    z-index: 0;
}

#canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
    background: white;
    z-index: 1; /* sidebar より低く */
}


#lens-info {
    position: fixed;
    top: 10px;
    right: 10px;
    max-width: 320px;
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 1.2rem;
    border: 1px solid #ccc;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
}

.hidden {
    display: none;
}

#menu-toggle {
    background: #007acc;
    color: #fff;
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 4px;
    margin-bottom: 1rem;
    cursor: pointer;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1000; /* 最前面に出す */
}

h2 {
    margin-top: 1.5rem;
    font-size: 1rem;
    color: #333;
}

input[type="text"] {
    width: 100%;
    padding: 0.4rem;
    margin-bottom: 1rem;
    box-sizing: border-box;
    font-size: 0.9rem;
}

input[type="range"] {
    width: 100%;
}

.filter-buttons button,
#manufacturer-buttons button {
    background-color: #e0e0e0;
    color: #333;
    border: 1px solid #ccc;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    margin: 0.2rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.2s;
}

.filter-buttons button:hover,
#manufacturer-buttons button:hover {
    background-color: #d0d0d0;
}

.filter {
    margin: 10px 0;
}

.filter input[type="range"] {
    width: 45%;
}

#imageCircleRangeValue {
    display: inline-block;
    width: 150px;
    margin-left: 10px;
}

#manufacturer-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 1rem;
}

#dark-toggle {
    background-color: #444;
    color: #fff;
    padding: 0.5rem;
    width: 100%;
    border: none;
    border-radius: 4px;
    margin-top: 0.5rem;
    cursor: pointer;
}

#dark-toggle:hover {
    background-color: #333;
}

/* ===== ダークモード ===== */
body.dark {
    background-color: #121212;
    color: #ddd;
}

body.dark #sidebar {
    background-color: #1e1e1e;
    border-right: 1px solid #333;
}

body.dark #main {
    background-color: #121212;
}

body.dark #lens-info {
    background-color: rgba(30, 30, 30, 0.95);
    color: #ddd;
    border-color: #444;
}

body.dark #menu-toggle {
    background: #444;
    color: #eee;
}

body.dark .filter-buttons button,
body.dark #manufacturer-buttons button {
    background-color: #333;
    color: #ddd;
    border-color: #555;
}

body.dark .filter-buttons button:hover,
body.dark #manufacturer-buttons button:hover {
    background-color: #555;
}

input[type="text"],
input[type="range"] {
    background-color: #fff;
    color: #000;
}

body.dark input[type="text"],
body.dark input[type="range"] {
    background-color: #222;
    color: #ddd;
    border: 1px solid #555;
}

/* 追記（ダークモード用SVG背景） */
body.dark #canvas {
    background: #222;
}

/* ===== 追加補助クラス ===== */
.cursor-pointer {
    cursor: pointer;
}

.underline {
    text-decoration: underline;
}
