* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(118, 75, 162, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(240, 147, 251, 0.1) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
    animation: backgroundShift 20s ease infinite;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255, 255, 255, 0.03) 35px, rgba(255, 255, 255, 0.03) 70px);
    pointer-events: none;
    z-index: 0;
}

@keyframes backgroundShift {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

body>* {
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    padding: 60px 50px;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 30px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
    position: relative;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 16px;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
    border-radius: 0 0 4px 4px;
}

header h1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.8em;
    margin-bottom: 16px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
}

.subtitle {
    color: #555;
    font-size: 1.15em;
    margin-bottom: 20px;
    font-weight: 400;
    letter-spacing: 0.3px;
}

.version-info {
    margin-top: 20px;
}

.version {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 25px;
    font-size: 0.85em;
    font-weight: 600;
    box-shadow:
        0 4px 15px rgba(102, 126, 234, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
}

.version:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(102, 126, 234, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.3) inset;
}

.version:active {
    transform: translateY(0);
}

/* ヘルプボタン */
.help-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 0.88em;
    font-weight: 600;
    cursor: pointer;
    margin-left: 12px;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.35);
    transition: all 0.3s ease;
}

.help-btn:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.45);
}

.help-btn:active {
    transform: translateY(0);
}

.manual-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 0.88em;
    font-weight: 600;
    text-decoration: none;
    margin-left: 12px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
    transition: all 0.3s ease;
}

.manual-link:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
    color: white;
}

.manual-link:active {
    transform: translateY(0);
}

footer {
    margin-top: 60px;
    padding: 30px;
    border-top: 2px solid rgba(102, 126, 234, 0.1);
    text-align: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.02) 0%, rgba(118, 75, 162, 0.02) 100%);
    border-radius: 16px;
}

.copyright {
    color: #777;
    font-size: 0.9em;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.upload-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.file-upload {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
}

.file-upload:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
}

.file-upload label {
    font-weight: 700;
    color: #333;
    font-size: 1.05em;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.file-description {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 12px;
    line-height: 1.5;
}

.file-upload input[type="file"] {
    padding: 16px;
    border: 2px dashed #667eea;
    border-radius: 12px;
    background: rgba(248, 249, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95em;
}

.file-upload input[type="file"]:hover {
    border-color: #764ba2;
    background: rgba(240, 242, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

.file-upload input[type="file"]:active {
    transform: translateY(0);
}

/* セッションマトリックス変換セクション */
.session-convert-section {
    margin: 20px 0 30px 0;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 165, 0, 0.15) 100%);
    border: 2px solid rgba(255, 165, 0, 0.4);
    border-radius: 16px;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

.session-convert-section:has(.session-convert-result) {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15) 0%, rgba(46, 125, 50, 0.15) 100%);
    border-color: rgba(76, 175, 80, 0.4);
}

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

.session-convert-notice {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.notice-icon {
    font-size: 2.5em;
    line-height: 1;
}

.notice-content h3 {
    color: #b8860b;
    font-size: 1.2em;
    margin-bottom: 8px;
    font-weight: 700;
}

.notice-content p {
    color: #666;
    font-size: 0.95em;
    line-height: 1.6;
    margin-bottom: 4px;
}

.session-convert-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.session-convert-actions .btn {
    padding: 12px 24px;
    font-size: 1em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* 変換完了結果セクション */
.session-convert-result {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.result-icon-large {
    font-size: 3em;
    line-height: 1;
}

.result-content h3 {
    color: #2e7d32;
    font-size: 1.3em;
    margin-bottom: 12px;
    font-weight: 700;
}

.result-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.stat-item {
    background: rgba(255, 255, 255, 0.8);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.95em;
    color: #333;
}

.stat-item strong {
    color: #667eea;
}

.result-note {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
    color: #555;
    font-size: 0.9em;
}

/* セッション更新モード制限 */
.mode-option.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.mode-option.disabled input {
    cursor: not-allowed;
}

.session-mode-note {
    margin-top: 12px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 152, 0, 0.15) 100%);
    border: 1px solid rgba(255, 152, 0, 0.4);
    border-radius: 8px;
    color: #856404;
    font-size: 0.9em;
    line-height: 1.5;
}

.mapping-section {
    margin-top: 40px;
}

.mapping-section h2 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    font-size: 2em;
    font-weight: 700;
    padding-bottom: 16px;
    border-bottom: 3px solid;
    border-image: linear-gradient(90deg, #667eea, #764ba2) 1;
    letter-spacing: -0.5px;
}

.instruction {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.mapping-settings {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.settings-header h3 {
    color: #333;
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.settings-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.save-control,
.load-control,
.file-control {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.file-control {
    padding-top: 16px;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
    margin-top: 8px;
}

.setting-input,
.setting-select {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 2px solid rgba(221, 221, 221, 0.5);
    border-radius: 10px;
    font-size: 0.95em;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.setting-input:focus,
.setting-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 1);
}

.setting-input::placeholder {
    color: #999;
}

.btn-save {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    white-space: nowrap;
}

.btn-save:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8f 100%);
}

.btn-load {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 12px 24px;
    white-space: nowrap;
}

.btn-load:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea080 100%);
}

.btn-delete {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 12px 24px;
    white-space: nowrap;
}

.btn-delete:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

.btn-export {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    padding: 12px 24px;
    white-space: nowrap;
}

.btn-export:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
}

.btn-import {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #333;
    padding: 12px 24px;
    white-space: nowrap;
    cursor: pointer;
    display: inline-block;
    font-weight: 600;
}

.btn-import:hover {
    background: linear-gradient(135deg, #e0a800 0%, #d39e00 100%);
    color: #000;
}

#mappingContainer {
    display: grid;
    gap: 18px;
    margin-bottom: 30px;
    max-height: 600px;
    overflow-y: auto;
    padding: 20px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(250, 250, 250, 0.8) 0%, rgba(245, 245, 245, 0.8) 100%);
    backdrop-filter: blur(10px);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.mapping-item {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 18px;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(102, 126, 234, 0.1) inset;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid transparent;
    position: relative;
    overflow: hidden;
}

.mapping-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #667eea, #764ba2);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.mapping-item:hover {
    box-shadow:
        0 8px 24px rgba(102, 126, 234, 0.15),
        0 0 0 1px rgba(102, 126, 234, 0.2) inset;
    transform: translateX(4px) translateY(-2px);
    background: rgba(255, 255, 255, 1);
}

.mapping-item:hover::before {
    transform: scaleY(1);
}

.mapping-label {
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

.mapping-select {
    padding: 12px 16px;
    border: 2px solid rgba(221, 221, 221, 0.5);
    border-radius: 10px;
    font-size: 0.95em;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.mapping-select:hover {
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(255, 255, 255, 1);
}

.mapping-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 1);
}

.mapping-select option {
    padding: 5px;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.btn:active {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8f 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea080 100%);
}

.result-section {
    margin-top: 40px;
    padding: 50px;
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.9) 0%, rgba(233, 236, 239, 0.9) 100%);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(222, 226, 230, 0.5);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-section h2 {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
    font-size: 2em;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.result-info {
    margin-bottom: 30px;
}

.result-info p {
    color: #666;
    margin-bottom: 10px;
    font-size: 1em;
}

#rowCount {
    font-weight: 600;
    color: #28a745;
    font-size: 1.1em;
}

.error-section {
    margin-top: 40px;
    padding: 40px;
    background: linear-gradient(135deg, rgba(255, 243, 205, 0.9) 0%, rgba(255, 234, 167, 0.9) 100%);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 193, 7, 0.5);
    border-radius: 20px;
    box-shadow:
        0 8px 32px rgba(255, 193, 7, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    animation: shake 0.5s ease-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.error-section h2 {
    color: #856404;
    margin-bottom: 15px;
    font-weight: 600;
}

#errorMessage {
    color: #856404;
    font-size: 1em;
}

/* スクロールバーのスタイル */
#mappingContainer::-webkit-scrollbar {
    width: 10px;
}

#mappingContainer::-webkit-scrollbar-track {
    background: rgba(241, 241, 241, 0.5);
    border-radius: 10px;
    margin: 5px;
}

#mappingContainer::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

#mappingContainer::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8f 100%);
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 2em;
    }

    .subtitle {
        font-size: 1em;
    }

    .version {
        font-size: 0.8em;
        padding: 5px 12px;
    }

    .upload-section {
        grid-template-columns: 1fr;
    }

    .mapping-item {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    footer {
        margin-top: 40px;
        padding-top: 20px;
    }

    .copyright {
        font-size: 0.85em;
    }

    .mapping-settings {
        padding: 20px;
    }

    .save-control,
    .load-control {
        flex-direction: column;
        align-items: stretch;
    }

    .setting-input,
    .setting-select {
        width: 100%;
        min-width: 100%;
    }

    .btn-save,
    .btn-load,
    .btn-delete,
    .btn-export,
    .btn-import {
        width: 100%;
    }

    .file-control {
        flex-direction: column;
        align-items: stretch;
    }
}

/* モーダルスタイル */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.modal-close {
    font-size: 2em;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.3s ease;
    user-select: none;
}

.modal-close:hover {
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

#versionHistory {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.version-item {
    padding: 20px;
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.8) 0%, rgba(233, 236, 239, 0.8) 100%);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.version-item:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.version-item.current-version {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 2px solid rgba(102, 126, 234, 0.3);
}

.version-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.version-number {
    font-size: 1.3em;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.current-badge {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.version-dates {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    flex-wrap: wrap;
}

.date-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-label {
    color: #666;
    font-size: 0.85em;
    font-weight: 600;
}

.date-value {
    color: #333;
    font-size: 0.9em;
    font-weight: 500;
}

.version-changes {
    list-style: none;
    padding: 0;
    margin: 0;
}

.version-changes li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    color: #555;
    line-height: 1.6;
}

.version-changes li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: 700;
    font-size: 1.1em;
}

.version-item.current-version .version-changes li::before {
    color: #764ba2;
}

/* スクロールバーのスタイル（モーダル内） */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8f 100%);
}

/* レスポンシブ（モーダル） */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 85vh;
    }

    .modal-header {
        padding: 20px;
    }

    .modal-header h2 {
        font-size: 1.5em;
    }

    .modal-body {
        padding: 20px;
    }

    .version-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .version-dates {
        flex-direction: column;
        gap: 8px;
    }

    .date-item {
        width: 100%;
    }
}

/* API設定セクション */
.api-settings-section {
    margin-bottom: 32px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 249, 255, 0.9) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 
        0 8px 32px rgba(102, 126, 234, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

.api-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 28px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.api-settings-header:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%);
}

.api-settings-header h2 {
    margin: 0;
    font-size: 1.35em;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 10px;
}

.api-settings-header h2::before {
    content: '⚙️';
    font-size: 0.85em;
}

.api-settings-toggle {
    font-size: 1.1em;
    color: #667eea;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
}

.api-settings-toggle.collapsed {
    transform: rotate(-90deg);
}

.api-settings-content {
    padding: 28px;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, transparent 100%);
}

.api-settings-content.hidden {
    display: none;
}

.api-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.api-setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.api-setting-item label {
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

.api-input,
.api-select {
    padding: 12px 16px;
    border: 2px solid rgba(221, 221, 221, 0.5);
    border-radius: 10px;
    font-size: 0.95em;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.api-input:focus,
.api-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 1);
}

.api-input::placeholder {
    color: #999;
}

.api-settings-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
}

.btn-test {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.btn-test:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
}

.btn-icon {
    position: absolute;
    right: 8px;
    top: 36px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.btn-icon:hover {
    background: rgba(102, 126, 234, 0.1);
}

.connection-status {
    font-size: 0.9em;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
}

.connection-status.success {
    color: #155724;
    background: rgba(40, 167, 69, 0.1);
}

.connection-status.error {
    color: #721c24;
    background: rgba(220, 53, 69, 0.1);
}

.connection-status.loading {
    color: #856404;
    background: rgba(255, 193, 7, 0.1);
}

/* API書き込みセクション */
.api-write-section {
    margin-top: 36px;
    padding: 32px;
    background: linear-gradient(145deg, #f8f9ff 0%, #ffffff 50%, #f5f7ff 100%);
    border-radius: 20px;
    border: 1px solid rgba(102, 126, 234, 0.15);
    box-shadow: 
        0 4px 20px rgba(102, 126, 234, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.api-write-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #667eea);
    background-size: 300% 100%;
    animation: gradientMove 4s ease infinite;
}

@keyframes gradientMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.api-write-section h3 {
    margin: 0 0 8px 0;
    font-size: 1.35em;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 10px;
}

.api-write-section h3::before {
    content: '📤';
    font-size: 0.9em;
}

.api-write-description {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px dashed rgba(102, 126, 234, 0.2);
}

/* API操作モード選択 */
.api-mode-selector {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.mode-option {
    flex: 1;
    min-width: 220px;
    cursor: pointer;
}

.mode-option input[type="radio"] {
    display: none;
}

.mode-label {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9ff 100%);
    border: 2px solid rgba(102, 126, 234, 0.15);
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.mode-label::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mode-option:hover .mode-label::before {
    opacity: 1;
}

.mode-option input[type="radio"]:checked + .mode-label {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    box-shadow: 
        0 8px 24px rgba(102, 126, 234, 0.25),
        0 0 0 1px rgba(102, 126, 234, 0.1) inset;
    transform: translateY(-2px);
}

.mode-option input[type="radio"]:checked + .mode-label::after {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: checkPop 0.3s ease;
}

@keyframes checkPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.mode-option:hover .mode-label {
    border-color: rgba(102, 126, 234, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
}

.mode-icon {
    font-size: 2.2em;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 14px;
    transition: all 0.3s ease;
}

.mode-option input[type="radio"]:checked + .mode-label .mode-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.mode-option input[type="radio"]:checked + .mode-label .mode-icon::after {
    filter: brightness(0) invert(1);
}

.mode-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    z-index: 1;
}

.mode-text strong {
    color: #333;
    font-size: 1.1em;
    font-weight: 700;
    transition: all 0.3s ease;
}

.mode-text small {
    color: #777;
    font-size: 0.88em;
    line-height: 1.4;
}

.mode-option input[type="radio"]:checked + .mode-label .mode-text strong {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.api-write-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-api {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 32px;
    font-size: 1.05em;
    font-weight: 600;
    border-radius: 14px;
    box-shadow: 
        0 6px 20px rgba(102, 126, 234, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    position: relative;
    overflow: hidden;
}

.btn-api::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-api:hover::before {
    left: 100%;
}

.btn-api:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8f 100%);
    box-shadow: 
        0 8px 28px rgba(102, 126, 234, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.3) inset;
    transform: translateY(-3px);
}

.btn-api:active {
    transform: translateY(-1px);
    box-shadow: 
        0 4px 16px rgba(102, 126, 234, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.btn-api:disabled {
    background: linear-gradient(135deg, #b0b5c0 0%, #9a9fa8 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-api:disabled::before {
    display: none;
}

/* 進捗バー */
.api-progress {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(145deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 16px;
    border: 1px solid rgba(102, 126, 234, 0.15);
}

.progress-bar {
    width: 100%;
    height: 16px;
    background: linear-gradient(135deg, rgba(221, 221, 221, 0.4) 0%, rgba(200, 200, 200, 0.4) 100%);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 1px 0 rgba(255, 255, 255, 0.8);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #667eea);
    background-size: 300% 100%;
    border-radius: 12px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: progressShimmer 2s linear infinite;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
}

@keyframes progressShimmer {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

.progress-text {
    margin-top: 14px;
    color: #555;
    font-size: 0.98em;
    text-align: center;
    font-weight: 500;
}

/* API書き込み結果 */
.api-result {
    margin-top: 24px;
    padding: 28px;
    border-radius: 16px;
    text-align: center;
    animation: resultPop 0.4s ease;
}

@keyframes resultPop {
    0% { transform: scale(0.9); opacity: 0; }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); opacity: 1; }
}

.api-result.success {
    background: linear-gradient(145deg, rgba(40, 167, 69, 0.08) 0%, rgba(32, 201, 151, 0.08) 100%);
    border: 2px solid rgba(40, 167, 69, 0.25);
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.15);
}

.api-result.error {
    background: linear-gradient(145deg, rgba(220, 53, 69, 0.08) 0%, rgba(200, 35, 51, 0.08) 100%);
    border: 2px solid rgba(220, 53, 69, 0.25);
    box-shadow: 0 4px 20px rgba(220, 53, 69, 0.15);
}

.result-icon {
    font-size: 3.5em;
    margin-bottom: 16px;
    animation: iconBounce 0.5s ease 0.2s;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.result-message {
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 14px;
}

.api-result.success .result-message {
    color: #155724;
}

.api-result.error .result-message {
    color: #721c24;
}

.result-details {
    font-size: 0.95em;
    color: #666;
    white-space: pre-line;
    padding: 16px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    margin-top: 12px;
    text-align: left;
    max-height: 200px;
    overflow-y: auto;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .api-settings-grid {
        grid-template-columns: 1fr;
    }

    .api-settings-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .api-settings-actions .btn {
        width: 100%;
    }

    .api-write-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .api-write-controls .btn {
        width: 100%;
    }
}

/* プロキシ設定 */
.proxy-settings {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.proxy-hint {
    color: #888;
    font-size: 0.85em;
    font-weight: 400;
}

.proxy-toggle-label {
    cursor: pointer;
    user-select: none;
}

.proxy-expand-icon {
    margin-left: auto;
    color: #667eea;
    font-size: 0.85em;
    transition: transform 0.2s ease;
}

.proxy-url-container {
    margin-top: 12px;
    padding: 16px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.proxy-url-container label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.proxy-help {
    margin-top: 8px;
    color: #666;
    font-size: 0.85em;
}

.proxy-help code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* データプレビューモーダル */
.modal-large {
    max-width: 90%;
    width: 1200px;
    max-height: 88vh;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    padding: 22px 32px;
    border-top: 1px solid rgba(102, 126, 234, 0.12);
    background: linear-gradient(180deg, rgba(248, 249, 255, 0.95) 0%, rgba(240, 242, 255, 0.95) 100%);
    border-radius: 0 0 20px 20px;
    box-shadow: 0 -4px 20px rgba(102, 126, 234, 0.05);
}

.preview-summary {
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-radius: 14px;
    margin-bottom: 20px;
    border: 1px solid rgba(102, 126, 234, 0.12);
}

.preview-summary p {
    margin: 6px 0;
    color: #333;
    font-size: 1em;
}

.preview-summary p strong {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.preview-summary span:not(.preview-note) {
    font-weight: 700;
    font-size: 1.1em;
}

.preview-note {
    color: #777 !important;
    font-size: 0.92em;
    margin-top: 10px !important;
    padding-top: 10px;
    border-top: 1px dashed rgba(102, 126, 234, 0.2);
}

.preview-table-container {
    max-height: 400px;
    overflow: auto;
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 10px;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.preview-table th,
.preview-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    white-space: nowrap;
}

.preview-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.preview-table th:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8f 100%);
}

.preview-table th.sortable::after {
    content: ' ⇅';
    opacity: 0.5;
    font-size: 0.8em;
}

.preview-table th.sort-asc::after {
    content: ' ▲';
    opacity: 1;
}

.preview-table th.sort-desc::after {
    content: ' ▼';
    opacity: 1;
}

.preview-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.preview-table tbody tr:nth-child(even) {
    background: rgba(102, 126, 234, 0.02);
}

.preview-table tbody tr:nth-child(even):hover {
    background: rgba(102, 126, 234, 0.08);
}

/* レスポンシブ */
@media (max-width: 768px) {
    .modal-large {
        max-width: 95%;
        width: 100%;
    }

    .preview-table-container {
        max-height: 300px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* プレビューフィルター */
.preview-filter {
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: 14px;
    border: 1px solid rgba(102, 126, 234, 0.12);
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.06);
}

.filter-row {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 280px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 14px 44px 14px 18px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    font-size: 0.98em;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.05);
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 
        0 0 0 4px rgba(102, 126, 234, 0.1),
        0 4px 16px rgba(102, 126, 234, 0.1);
}

.search-input::placeholder {
    color: #aaa;
}

.btn-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(220, 53, 69, 0.08);
    border: none;
    color: #999;
    cursor: pointer;
    padding: 6px 10px;
    font-size: 0.95em;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-clear:hover {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
    transform: translateY(-50%) scale(1.05);
}

.filter-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-field label {
    font-size: 0.92em;
    color: #555;
    white-space: nowrap;
    font-weight: 500;
}

.filter-select {
    padding: 12px 16px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 10px;
    font-size: 0.92em;
    background: white;
    cursor: pointer;
    min-width: 160px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.05);
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* プレビューコントロール */
.preview-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.btn-small {
    padding: 10px 18px;
    font-size: 0.88em;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.25s ease;
}

.btn-small:hover {
    transform: translateY(-2px);
}

/* ハイライト */
.highlight {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(255, 193, 7, 0.3);
}

/* 選択可能な行 */
.preview-table .row-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.preview-table tr.selected {
    background: rgba(102, 126, 234, 0.15) !important;
}

/* ヘルプモーダル */
.modal-help {
    max-width: 900px;
    width: 90%;
}

.help-content {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.help-section {
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.help-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.help-section h3 {
    margin: 0 0 16px 0;
    font-size: 1.25em;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* クイックスタートのステップ */
.help-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: step;
}

.help-steps li {
    position: relative;
    padding: 14px 16px 14px 56px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 12px;
    border-left: 4px solid #667eea;
    counter-increment: step;
    transition: all 0.3s ease;
}

.help-steps li:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transform: translateX(4px);
}

.help-steps li::before {
    content: counter(step);
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9em;
}

.help-steps li strong {
    color: #667eea;
}

/* 機能説明 */
.help-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.help-feature {
    display: flex;
    gap: 14px;
    padding: 18px;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: 14px;
    border: 1px solid rgba(102, 126, 234, 0.12);
    transition: all 0.3s ease;
}

.help-feature:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.12);
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 2em;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 12px;
    flex-shrink: 0;
}

.feature-content h4 {
    margin: 0 0 6px 0;
    font-size: 1em;
    font-weight: 700;
    color: #333;
}

.feature-content p {
    margin: 0;
    font-size: 0.9em;
    color: #666;
    line-height: 1.5;
}

/* ヘルプテーブル */
.help-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.help-table th,
.help-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.help-table th {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    font-weight: 600;
    color: #333;
}

.help-table tr:hover td {
    background: rgba(102, 126, 234, 0.03);
}

/* 書き込みモード説明 */
.help-modes {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.help-mode {
    flex: 1;
    min-width: 250px;
    padding: 18px;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: 14px;
    border: 1px solid rgba(102, 126, 234, 0.12);
}

.mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.95em;
    margin-bottom: 10px;
}

.mode-badge.create {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    color: #667eea;
}

.mode-badge.update {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.15) 0%, rgba(19, 132, 150, 0.15) 100%);
    color: #17a2b8;
}

.help-mode p {
    margin: 0;
    color: #666;
    font-size: 0.92em;
    line-height: 1.5;
}

/* FAQ */
.help-faq {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.faq-item {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.12);
    overflow: hidden;
}

.faq-item summary {
    padding: 16px 20px;
    cursor: pointer;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::before {
    content: '▶';
    font-size: 0.7em;
    color: #667eea;
    transition: transform 0.3s ease;
}

.faq-item[open] summary::before {
    transform: rotate(90deg);
}

.faq-item summary:hover {
    background: rgba(102, 126, 234, 0.05);
}

.faq-item p {
    margin: 0;
    padding: 0 20px 16px;
    color: #666;
    font-size: 0.92em;
    line-height: 1.6;
}

.faq-item code {
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    color: #667eea;
}

/* ヒント */
.help-tips {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.help-tips li {
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.08) 0%, rgba(255, 179, 71, 0.08) 100%);
    border-radius: 10px;
    border-left: 4px solid #ffc107;
    font-size: 0.92em;
    color: #555;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .modal-help {
        max-width: 95%;
    }

    .help-features {
        grid-template-columns: 1fr;
    }

    .help-modes {
        flex-direction: column;
    }

    .help-tips {
        grid-template-columns: 1fr;
    }

    .help-btn {
        margin-left: 0;
        margin-top: 12px;
    }

    .version-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
}

/* 処理結果ステータスアイコン */
.result-status-cell {
    text-align: center;
    width: 50px;
    min-width: 50px;
}

.result-status-success {
    color: #28a745;
    font-size: 1.3em;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(40, 167, 69, 0.4);
    cursor: default;
}

.result-status-error {
    color: #dc3545;
    font-size: 1.3em;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(220, 53, 69, 0.4);
    cursor: pointer;
}

.result-status-error:hover {
    text-shadow: 0 0 12px rgba(220, 53, 69, 0.8);
}

.result-error-msg {
    display: block;
    font-size: 0.75em;
    color: #dc3545;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

.result-status-cell {
    min-width: 80px;
}

.result-status-pending {
    color: #ffc107;
    font-size: 1.3em;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(255, 193, 7, 0.4);
}

/* 処理結果による行の背景色 */
.preview-table tr.row-success {
    background: rgba(40, 167, 69, 0.08) !important;
}

.preview-table tr.row-success:hover {
    background: rgba(40, 167, 69, 0.15) !important;
}

.preview-table tr.row-error {
    background: rgba(220, 53, 69, 0.08) !important;
}

.preview-table tr.row-error:hover {
    background: rgba(220, 53, 69, 0.15) !important;
}

/* プロキシタイプ選択 */
.proxy-type-selector {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    padding: 10px 16px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.radio-label:hover {
    background: rgba(102, 126, 234, 0.1);
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.radio-label input[type="radio"]:checked + span {
    color: #667eea;
    font-weight: 600;
}

.proxy-type-selector .radio-label:has(input:checked) {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

/* ===== ログイン画面 ===== */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    z-index: 10000;
}

.login-container {
    background: rgba(30, 32, 40, 0.95);
    border-radius: 24px;
    padding: 48px;
    max-width: 420px;
    width: 90%;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    backdrop-filter: blur(20px);
    text-align: center;
    animation: loginFadeIn 0.5s ease;
}

@keyframes loginFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-header {
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 2.5em;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.login-subtitle {
    color: #a0a8c0;
    font-size: 1.1em;
    font-weight: 500;
}

.login-body {
    margin-bottom: 32px;
}

.login-description {
    color: #8892a8;
    font-size: 0.95em;
    margin-bottom: 24px;
    line-height: 1.6;
}

.btn-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #2f3542 0%, #3d4555 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-login:hover:not(:disabled) {
    background: linear-gradient(135deg, #3d4555 0%, #4a5568 100%);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-login .ms-icon {
    width: 24px;
    height: 24px;
}

.login-error {
    margin-top: 20px;
    padding: 14px 18px;
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 10px;
    color: #ff6b6b;
    font-size: 0.9em;
    text-align: left;
}

.login-footer {
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.login-footer p {
    color: #5a6175;
    font-size: 0.85em;
}

/* ===== メインアプリ ===== */
.main-app {
    animation: mainAppFadeIn 0.4s ease;
}

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

/* ===== ヘッダー（ユーザー情報付き） ===== */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 8px;
}

.header-top h1 {
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(102, 126, 234, 0.1);
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.user-name {
    color: #c9d1e8;
    font-size: 0.9em;
    font-weight: 500;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    padding: 6px 14px;
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 6px;
    color: #ff6b6b;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: rgba(220, 53, 69, 0.25);
    border-color: rgba(220, 53, 69, 0.5);
}

/* レスポンシブ対応 */
@media (max-width: 600px) {
    .login-container {
        padding: 32px 24px;
    }
    
    .login-header h1 {
        font-size: 2em;
    }
    
    .header-top {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .user-info {
        width: 100%;
        justify-content: space-between;
    }
}