body {
    font-family: Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f5f5;
}

.container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 30px;
}

.input-section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.color-input {
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-input label {
    min-width: 120px;
    font-weight: bold;
}

input[type="color"] {
    width: 50px;
    height: 30px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.upload-area {
    margin: 20px 0;
    padding: 40px 20px;
    border: 2px dashed #90caf9;
    border-radius: 12px;
    text-align: center;
    background: linear-gradient(135deg, #f3f9ff 0%, #e3f2fd 100%);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.upload-area:hover {
    border-color: #2196f3;
}

.upload-area.drag-over {
    border-color: #1976d2;
    background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(25, 118, 210, 0.25);
}

#uploadText {
    color: #424242;
    font-size: 16px;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

#resolutionText {
    color: #757575;
    font-size: 14px;
    font-weight: 300;
}

.file-input {
    display: none;
}

.upload-btn {
    background-color: #2196f3;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.upload-btn:hover {
    background-color: #1976d2;
}

input[type="file"] {
    margin: 10px 0;
}

.preview-section {
    margin: 20px 0;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

.layer-previews {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.main-preview {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.preview-item {
    text-align: center;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.preview-item h3 {
    margin-top: 0;
    color: #555;
}

canvas {
    max-width: 100%;
    border: 1px solid #ccc;
    border-radius: 3px;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin: 10px 5px;
}

button:hover {
    background-color: #0056b3;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.download-section {
    margin-top: 30px;
    text-align: center;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f0f8ff;
}

.layer-info {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.pcb-canvas {
    max-width: 100%;
    border: 2px solid #333;
    border-radius: 5px;
    background-color: #1a5d1a;
}

.pcb-layers {
    position: relative;
    display: inline-block;
}

.threshold-section {
    margin: 30px 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.unified-threshold {
    margin: 15px 0;
    padding: 20px;
    background: white;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.unified-threshold label {
    font-weight: bold;
    color: #333;
    display: block;
    margin-bottom: 15px;
}

.unified-slider {
    position: relative;
    height: 60px;
    width: 100%;
    margin: 20px 0;
}

.slider-track {
    position: absolute;
    top: 25px;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(to right, #000000, #404040, #808080, #c0c0c0, #ffffff);
    border-radius: 5px;
    border: 1px solid #ccc;
}

.layer-range {
    position: absolute;
    height: 10px;
    top: 25px;
    border-radius: 5px;
    opacity: 0.8;
}

.layer-range[data-layer="0"] { background: rgba(255, 107, 107, 0.6); }
.layer-range[data-layer="1"] { background: rgba(78, 205, 196, 0.6); }
.layer-range[data-layer="2"] { background: rgba(69, 183, 209, 0.6); }
.layer-range[data-layer="3"] { background: rgba(255, 193, 7, 0.6); }
.layer-range[data-layer="4"] { background: rgba(156, 39, 176, 0.6); }

.slider-handle {
    position: absolute;
    width: 16px;
    height: 40px;
    background: #007bff;
    border: 2px solid white;
    border-radius: 3px;
    cursor: pointer;
    top: 10px;
    transform: translateX(-50%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 20;
}

.slider-handle:hover {
    background: #0056b3;
    transform: translateX(-50%) scale(1.05);
}

.slider-handle.active {
    background: #0056b3;
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #666;
    margin-top: 10px;
    text-align: center;
}

.slider-labels span {
    flex: 1;
    padding: 0 5px;
}

.threshold-values {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.threshold-value {
    display: flex;
    align-items: center;
    gap: 5px;
}

.threshold-input {
    width: 60px;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    text-align: center;
}

.download-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin: 8px 0;
    width: 100%;
}

.download-btn:hover {
    background-color: #218838;
}

.download-btn-primary {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    margin: 10px 0;
    width: 100%;
}

.download-btn-primary:hover {
    background-color: #218838;
}

/* Info ボタン */
.info-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(33, 150, 243, 0.8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.info-button:hover {
    background: rgba(33, 150, 243, 1);
    transform: scale(1.1);
}

/* Info ポップアップ */
.info-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.info-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px 15px;
    border-bottom: 1px solid #eee;
}

.info-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background-color: #f0f0f0;
}

.info-body {
    padding: 20px 25px 25px;
}

.info-section {
    margin-bottom: 20px;
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-section h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
}

.info-section p {
    margin: 5px 0;
    color: #555;
    line-height: 1.5;
}

.license-text {
    font-size: 12px;
    color: #777;
    font-family: monospace;
    background: #f8f8f8;
    padding: 5px 8px;
    border-radius: 3px;
    margin: 8px 0;
}

.info-section a {
    color: #2196f3;
    text-decoration: none;
    font-size: 14px;
}

.info-section a:hover {
    text-decoration: underline;
}

.author-links {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.author-link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.author-link:hover {
    background: #e0e0e0;
    text-decoration: none;
}

.info-section ol {
    margin: 10px 0;
    padding-left: 20px;
}

.info-section ol li {
    margin: 5px 0;
    color: #555;
}

/* フッター */
.footer {
    background-color: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    padding: 15px 20px;
    margin-top: 40px;
    color: #666;
    font-size: 14px;
}

.footer p {
    margin: 0;
}

/* 利用規約ボタン */
.terms-btn {
    background-color: #2196f3;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 15px;
    transition: background-color 0.2s;
}

.terms-btn:hover {
    background-color: #1976d2;
}