* Reset and Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #1e293b;
    background-color: #fafafa;
    color-scheme: light only;
    /* Modern subtle mesh background */
    background-image: 
        radial-gradient(at 0% 0%, hsla(217,100%,94%,1) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(253,100%,94%,1) 0, transparent 50%),
        radial-gradient(at 100% 100%, hsla(217,100%,92%,1) 0, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Header */
.site-header {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    padding: 16px 0;
    margin-bottom: 40px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.02), 0 1px 2px -1px rgba(0, 0, 0, 0.01);
}

.header-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-title {
    font-size: 1.4rem;
    color: #0f172a;
    letter-spacing: -0.02em;
    line-height: 1;
}

/* Main Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Hero Area */
.hero-area {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 10px;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 16px;
    letter-spacing: -0.04em;
    line-height: 1.3;
}

.hero-description {
    font-size: 1.1rem;
    color: #475569;
    line-height: 1.7;
}

.hero-description strong {
    color: #2563eb;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #ffffff;
    color: #334155;
    padding: 8px 16px;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -2px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

.hero-badge:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -4px rgba(0, 0, 0, 0.02);
    transform: translateY(-1px);
}

.hero-badge svg {
    color: #3b82f6;
}

/* Modal Overlay for Preview */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85); /* Dark slate background */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.2s ease-in-out;
}
.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.modal-overlay > .modal-content {
    background: #fff;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 98vw;
    max-height: 95vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: scale(1);
    transition: transform 0.2s ease-in-out;
}
.modal-overlay.hidden .modal-content {
    transform: scale(0.95);
}
.modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 34px;
    height: 34px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #ef4444;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    z-index: 10;
    border: 1px solid #e2e8f0;
}
.modal-close:hover {
    background: #fef2f2;
}
.modal-image-container {
    overflow: auto;
    max-height: calc(95vh - 70px); /* Leave room for text */
    display: flex;
    justify-content: center;
    border-radius: 8px;
    background: #f8fafc url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+CjxyZWN0IHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0iI2ZmZiIgLz4KPHBhdGggZD0iTTAgMTBoMjBNMTAgMHYyMCIgc3Ryb2tlPSIjZTNlOGVmIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIC8+Cjwvc3ZnPg==') repeat;
}
.modal-image-container img {
    /* 螳滄圀縺ｮ蛻ｩ逕ｨ繧ｵ繧､繧ｺ縺ｫ霑代＞蠖｢縺ｧ陦ｨ遉ｺ縲ゅ◆縺縺礼判髱｢縺九ｉ縺ｯ縺ｿ蜃ｺ縺輔↑縺・ｨ句ｺｦ縺ｫ隱ｿ謨ｴ */
    max-width: 100%;
    height: auto;
    display: block;
}
.modal-info {
    margin-top: 6px;
    text-align: center;
    font-size: 0.9rem;
    color: #334155;
}

/* Notice Box / Security Badge */
.notice-box {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    border-left: 4px solid #3b82f6;
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
    margin-bottom: 30px;
    font-size: 0.95rem;
    color: #1e293b;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.notice-box strong {
    color: #2563eb;
}

/* Converter Area - Soft Glass */
.converter-area {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    padding: 40px;
    margin-bottom: 40px;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed #93c5fd;
    border-radius: 12px;
    background-color: rgba(239, 246, 255, 0.5);
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drop-zone:hover:not(.busy) {
    background-color: rgba(219, 234, 254, 0.8);
    border-color: #3b82f6;
    transform: translateY(-2px);
}

.drop-zone.dragover:not(.busy) {
    background-color: rgba(191, 219, 254, 0.9);
    border-color: #2563eb;
    border-style: solid;
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 3px rgba(37, 99, 235, 0.15), 0 0 20px rgba(37, 99, 235, 0.12);
    transition: none;
}

.drop-zone.busy {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    pointer-events: none;
}

.upload-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
    filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.2));
}

.drop-zone p {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.drop-zone .sub-text {
    font-size: 0.9rem;
    font-weight: normal;
    color: #64748b;
}

/* Controls */
.controls {
    margin-top: 35px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
}

.preview-area, .settings-area {
    width: 100%;
    max-width: 800px;
}

.hidden {
    display: none !important;
}

/* Content Area for SEO & Information */
.content-area {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.content-box {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.content-box h2 {
    font-size: 1.4rem;
    color: #1e293b;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.content-box h3 {
    font-size: 1.1rem;
    color: #334155;
    margin-top: 25px;
    margin-bottom: 10px;
}

.content-box p {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.7;
    margin-bottom: 15px;
}

.usage-list {
    padding-left: 20px;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.8;
}

.usage-list li {
    margin-bottom: 10px;
}

.faq-list dt {
    font-weight: 600;
    color: #334155;
    margin-top: 20px;
    margin-bottom: 8px;
    font-size: 1rem;
}

.faq-list dd {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-left: 0;
    padding-left: 20px;
    border-left: 3px solid #cbd5e1;
}


/* File List Area */
.preview-area {
    flex: 1;
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
}

.area-title-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 8px;
    padding-bottom: 8px;
}

.area-title {
    font-size: 0.95rem;
    color: #334155;
    font-weight: 700;
    margin: 0;
}

.clear-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.clear-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.file-list {
    list-style: none;
    max-height: 120px;
    overflow-y: auto;
}

.file-item {
    font-size: 0.8rem;
    padding: 6px 5px;
    border-bottom: 1px dashed #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #475569;
}

.file-item:last-child {
    border-bottom: none;
}

/* Settings */
.settings-area {
    flex: 1;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #334155;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    background-color: #fff;
    color: #334155;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control-range {
    width: 100%;
    margin-top: 5px;
    accent-color: #3b82f6;
}

.disabled-group {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(100%);
}

/* Quality Stepper */
.stepper-wrap {
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.stepper-btn {
    flex: 1;
    padding: 8px;
    background: #f1f5f9;
    border: none;
    font-size: 1.2rem;
    color: #475569;
    font-weight: 900;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.stepper-btn:hover {
    background: #e2e8f0;
}

.stepper-btn:active {
    background: #cbd5e1;
}

.stepper-value {
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: #1e293b;
    border-left: 1px solid #cbd5e1;
    border-right: 1px solid #cbd5e1;
    background: #ffffff;
}

.stepper-unit {
    font-size: 0.9rem;
    color: #64748b;
    margin-left: 2px;
    font-weight: 600;
}

.quality-presets {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.preset-btn {
    flex: 1;
    padding: 12px 4px;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn:hover {
    background-color: #f1f5f9;
    border-color: #94a3b8;
    color: #334155;
}

.preset-btn.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.25);
}



.drop-zone .sub-text {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 0;
}

.drop-zone .format-text {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 8px;
    margin-bottom: 0;
}

.help-text {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 6px;
}

.pro-tip {
    margin-top: 12px;
    padding: 12px 15px;
    background-color: #fffbeb;
    border-left: 4px solid #f59e0b;
    border-radius: 4px 8px 8px 4px;
    font-size: 0.85rem;
    color: #92400e;
    line-height: 1.5;
}

.pro-tip strong {
    color: #b45309;
}

/* Buttons - Vibrant Gradient */
.btn-primary {
    display: block;
    width: 100%;
    padding: 15px;
    background: #0f172a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.btn-primary:disabled {
    background: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Result Summary */
@keyframes popIn {
    0% { opacity: 0; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}

.result-summary {
    margin-top: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border: 2px solid #34d399;
    border-radius: 12px;
    text-align: center;
    color: #064e3b;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.1), 0 4px 6px -2px rgba(16, 185, 129, 0.05);
}

.res.bug-modal-title {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #1e293b;
}

/* Modern Accordion */
.modern-accordion {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    overflow: hidden;
    transition: all 0.2s ease;
}
.modern-accordion:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.03);
}
.modern-accordion summary {
    padding: 20px;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modern-accordion summary::-webkit-details-marker {
    display: none;
}
.modern-accordion summary h2 {
    margin: 0;
    font-size: 1.15rem;
    color: #0f172a;
    border-bottom: none;
    padding-bottom: 0;
}
.modern-accordion summary::after {
    content: '+';
    font-size: 1.5rem;
    color: #64748b;
    font-weight: 300;
    line-height: 1;
}
.modern-accordion[open] summary::after {
    content: '竏・;
}
.modern-accordion .accordion-body {
    padding: 0 20px 20px;
    color: #475569;
    font-size: 0.95rem;
}
.modern-accordion .accordion-body h3 {
    font-size: 1.05rem;
    margin-top: 20px;
    margin-bottom: 10px;
    color: #1e293b;
}
.modern-accordion .accordion-body p {
    margin-bottom: 12px;
}
.modern-accordion .accordion-body dt {
    font-weight: bold;
    color: #1e293b;
    margin-top: 15px;
    margin-bottom: 5px;
}
.modern-accordion .accordion-body dd {
    margin-left: 0;
    padding-left: 15px;
    border-left: 3px solid #e2e8f0;
    margin-bottom: 15px;
    color: #475569;
}

.result-title {
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.result-stats {
    font-size: 1.15rem;
    font-weight: 800;
    color: #047857;
    margin: 12px 0;
    background: #fff;
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px dashed #6ee7b7;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.result-saved {
    font-size: 1rem;
    color: #065f46;
    margin-top: 4px;
}

.result-saved strong {
    font-size: 1.4rem;
    color: #10b981;
    font-weight: 900;
    text-shadow: 0 1px 2px rgba(16, 185, 129, 0.2);
}


/* Ads */
.ad-container {
    margin-top: 40px;
    text-align: center;
}

.ad-top {
    margin-top: 15px;
    margin-bottom: 25px;
}

.ad-above-drop {
    margin-top: 10px;
    margin-bottom: 20px;
}

.ad-below-btn {
    margin-top: 20px;
    margin-bottom: 5px;
}

.ad-result {
    margin-top: 25px;
    margin-bottom: 10px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #fff;
    padding: 12px;
    border-radius: 10px;
    width: 95%;
    max-width: 800px;
    max-height: 95vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.modal-image-container {
    width: 100%;
    text-align: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 8px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    transition: width 0.1s, max-width 0.1s, max-height 0.1s;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2rem;
    color: #1e293b;
}

.modal-desc {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 20px;
    line-height: 1.4;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 50;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.ad-bottom {
    margin-top: 40px;
    margin-bottom: 20px;
}

.ad-placeholder {
    display: inline-block;
    width: 100%;
    max-width: 728px;
    height: 90px;
    background-color: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    color: #94a3b8;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.ad-placeholder p {
    margin: 0;
}

/* FAQ */
.faq-area {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 35px;
    margin-bottom: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.faq-area h2 {
    font-size: 1.3rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 12px;
    margin-bottom: 25px;
    color: #1e293b;
    font-weight: 800;
}

.faq-area dt {
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.faq-area dd {
    margin-bottom: 25px;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.7;
    padding-left: 15px;
    border-left: 2px solid #e2e8f0;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 30px 0;
    color: #64748b;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
    }
    .preview-area, .settings-area {
        width: 100%;
    }

    /* モーダル: モバイル対応 */
    .modal-overlay {
        align-items: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 10px 0;
    }
    .modal-overlay > .modal-content {
        max-height: none;
        width: 98vw;
        margin: 0 auto;
        border-radius: 10px;
    }
    .modal-image-container {
        max-height: none;
    }
    .modal-image-container img {
        max-height: 40vh;
    }
    .modal-close {
        top: 4px;
        right: 4px;
    }

    /* 設定モーダル: モバイル対応 */
    .modal-content {
        max-height: none;
        width: 96%;
    }
}
