* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Yu Gothic', 'Meiryo', sans-serif;
    background: radial-gradient(ellipse at bottom, #0d1b2a 0%, #1b263b 50%, #0f172a 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: white;
    position: relative;
}

/* Background stars animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 160px 30px, rgba(255,255,255,0.4), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: twinkle 3s infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.4; }
}

/* ヘッダースタイル */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    font-weight: 600;
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.header-link:hover {
    color: #60a5fa;
}

.header-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.container {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 40px;
    max-width: 500px;
    width: 100%;
    border: 1px solid rgba(59, 130, 246, 0.2);
    position: relative;
    z-index: 1;
    margin-top: 80px;
}

h1 {
    color: #f1f5f9;
    text-align: center;
    margin-bottom: 10px;
    font-size: 28px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3), 0 4px 6px rgba(0, 0, 0, 0.5);
}

.subtitle {
    text-align: center;
    color: rgba(241, 245, 249, 0.8);
    margin-bottom: 20px;
    font-size: 14px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.security-badge-container {
    text-align: center;
    margin-bottom: 25px;
}

.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(16, 185, 129, 0.15));
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 0.9rem;
    color: #4ade80;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.1);
    backdrop-filter: blur(10px);
    animation: fadeInScale 0.5s ease-out;
}

.badge-icon {
    font-size: 1.1rem;
    animation: pulse 2s ease-in-out infinite;
}

.badge-text {
    letter-spacing: 0.3px;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.prefix-input-container {
    background: rgba(15, 23, 42, 0.5);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.prefix-label {
    display: block;
    color: #f1f5f9;
    font-weight: bold;
    margin-bottom: 12px;
    font-size: 14px;
}

.input-group {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px;
    margin-bottom: 15px;
}

.prefix-select {
    grid-column: 1 / 2;
    padding: 12px;
    border: 2px solid rgba(59, 130, 246, 0.4);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: rgba(15, 23, 42, 0.7);
    color: #f1f5f9;
    cursor: pointer;
}

.prefix-select:hover {
    border-color: rgba(59, 130, 246, 0.7);
    background: rgba(15, 23, 42, 0.85);
}

.prefix-select:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background: rgba(15, 23, 42, 0.9);
}

.prefix-input {
    grid-column: 2 / 3;
    padding: 12px;
    border: 2px solid rgba(59, 130, 246, 0.4);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: rgba(15, 23, 42, 0.7);
    color: #f1f5f9;
}

.prefix-input:hover {
    border-color: rgba(59, 130, 246, 0.7);
    background: rgba(15, 23, 42, 0.85);
}

.prefix-input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background: rgba(15, 23, 42, 0.9);
}

.button-group {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.manage-prefix-btn {
    width: 100%;
    padding: 10px 16px;
    border: 2px solid rgba(59, 130, 246, 0.4);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(15, 23, 42, 0.7);
    color: #f1f5f9;
    margin-top: 12px;
}

.manage-prefix-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #60a5fa;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.manage-prefix-btn:active {
    transform: translateY(0);
}

/* トーストスタイル */
.toast {
    position: fixed;
    top: 100px;
    right: 20px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    color: #f1f5f9;
    padding: 16px 24px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 3000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
    border: 1px solid rgba(59, 130, 246, 0.3);
    min-width: 300px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.toast.success {
    border-color: rgba(16, 185, 129, 0.5);
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.5);
}

.toast.warning {
    border-color: rgba(251, 191, 36, 0.5);
}

.toast-icon {
    font-size: 24px;
}

.toast-message {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
}

/* モーダルスタイル */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    color: #f1f5f9;
    font-size: 20px;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: rgba(241, 245, 249, 0.6);
    font-size: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: #f1f5f9;
    background: rgba(239, 68, 68, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

.add-section {
    margin-bottom: 25px;
}

.modal-label {
    display: block;
    color: #f1f5f9;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 14px;
}

.add-input-group {
    display: flex;
    gap: 10px;
}

.modal-input {
    flex: 1;
    padding: 12px;
    border: 2px solid rgba(59, 130, 246, 0.4);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: rgba(15, 23, 42, 0.7);
    color: #f1f5f9;
}

.modal-input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background: rgba(15, 23, 42, 0.9);
}

.modal-add-btn {
    padding: 12px 20px;
    border: 2px solid rgba(16, 185, 129, 0.4);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(16, 185, 129, 0.2);
    color: #f1f5f9;
    white-space: nowrap;
}

.modal-add-btn:hover {
    background: rgba(16, 185, 129, 0.3);
    border-color: #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

.modal-add-btn:active {
    transform: translateY(0);
}

.list-section {
    margin-top: 20px;
}

.prefix-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.prefix-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.prefix-item:hover {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(59, 130, 246, 0.4);
}

.prefix-item-text {
    color: #f1f5f9;
    font-size: 15px;
    word-break: break-all;
}

.prefix-item-delete {
    background: none;
    border: none;
    color: rgba(239, 68, 68, 0.7);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 5px;
}

.prefix-item-delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.1);
}

.prefix-item-delete:active {
    transform: scale(0.95);
}

.position-options {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: rgba(241, 245, 249, 0.9);
    font-size: 14px;
    transition: all 0.3s;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 8px;
    position: relative;
}

.radio-label:hover {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
    transform: translateX(2px);
}

.radio-label input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    margin-right: 12px;
    cursor: pointer;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(148, 163, 184, 0.5);
    border-radius: 50%;
    background: transparent;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.radio-label input[type="radio"]:hover {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.1);
}

.radio-label input[type="radio"]:checked {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.radio-label input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    animation: radioCheck 0.3s ease;
}

@keyframes radioCheck {
    0% {
        transform: translate(-50%, -50%) scale(0);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

.radio-label span {
    user-select: none;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: rgba(241, 245, 249, 0.9);
    font-size: 14px;
    transition: all 0.3s;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 8px;
    position: relative;
}

.checkbox-label:hover {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
    transform: translateX(2px);
}

.checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    margin-right: 12px;
    cursor: pointer;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(148, 163, 184, 0.5);
    border-radius: 4px;
    background: transparent;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:hover {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.1);
}

.checkbox-label input[type="checkbox"]:checked {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    animation: checkboxCheck 0.3s ease;
}

@keyframes checkboxCheck {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(-45deg);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2) rotate(5deg);
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
}

.checkbox-label span {
    user-select: none;
}

.zip-options {
    margin-top: 15px;
}

.zip-options-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 15px 0;
}

.zip-options-label {
    display: block;
    color: #f1f5f9;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 14px;
}

.processing-message {
    text-align: center;
    color: #60a5fa;
    font-weight: bold;
    padding: 20px;
    display: none;
}

.processing-message.active {
    display: block;
}

.upload-area {
    border: 3px dashed rgba(59, 130, 246, 0.6);
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(15, 23, 42, 0.5);
    margin-bottom: 20px;
}

.upload-area:hover {
    background: rgba(15, 23, 42, 0.7);
    border-color: rgba(96, 165, 250, 0.8);
}

.upload-area.dragover {
    background: rgba(30, 58, 138, 0.3);
    border-color: #60a5fa;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.upload-text {
    color: rgba(241, 245, 249, 0.9);
    font-weight: bold;
    margin-bottom: 10px;
}

.upload-subtext {
    color: rgba(241, 245, 249, 0.6);
    font-size: 13px;
}

input[type="file"] {
    display: none;
}

.file-info {
    background: rgba(15, 23, 42, 0.6);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.file-info.active {
    display: block;
}

.file-name {
    font-weight: bold;
    color: #f1f5f9;
    margin-bottom: 10px;
    word-break: break-all;
}

.new-file-name {
    color: #60a5fa;
    font-weight: bold;
    margin-top: 10px;
    padding: 10px;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 5px;
    word-break: break-all;
}

.label {
    color: rgba(241, 245, 249, 0.7);
    font-size: 13px;
    margin-bottom: 5px;
}

.download-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: none;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.download-btn.active {
    display: block;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
    background: linear-gradient(45deg, #059669, #047857);
}

.download-btn:active {
    transform: translateY(0);
}

.reset-btn {
    width: 100%;
    padding: 12px;
    background: rgba(15, 23, 42, 0.6);
    color: rgba(241, 245, 249, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
    display: none;
}

.reset-btn.active {
    display: block;
}

.reset-btn:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 600px) {
    .container {
        padding: 25px;
    }

    h1 {
        font-size: 24px;
    }

    .upload-area {
        padding: 30px 20px;
    }
    
    .input-group {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .prefix-select,
    .prefix-input {
        grid-column: 1 / -1;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .add-prefix-btn,
    .remove-prefix-btn {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .add-input-group {
        flex-direction: column;
    }
    
    .modal-add-btn {
        width: 100%;
    }
}

/* 確認モーダル */
.confirm-modal {
    max-width: 400px;
}

.confirm-message {
    color: #f1f5f9;
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

.modal-footer {
    display: flex;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn {
    background: rgba(15, 23, 42, 0.7);
    color: rgba(241, 245, 249, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cancel-btn:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(255, 255, 255, 0.3);
}

.ok-btn {
    background: linear-gradient(45deg, #ef4444, #dc2626);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ok-btn:hover {
    background: linear-gradient(45deg, #dc2626, #b91c1c);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

@media (max-width: 600px) {
    .toast {
        right: 10px;
        left: 10px;
        min-width: auto;
        top: 80px;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-btn {
        width: 100%;
    }
}