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

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Site Navigation */
.site-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e2e8f0;
}

.nav-link {
    color: #4a5568;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s;
}

.nav-link:hover {
    color: #5a67d8;
    background: #eef2ff;
}

.nav-link.active {
    color: #5a67d8;
    font-weight: 600;
}

header {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

header p {
    opacity: 0.9;
    font-size: 0.95rem;
}

.lang-switch {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 5px;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lang-btn.active {
    background: white;
    color: #5a67d8;
}

main {
    padding: 30px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s;
    color: #4a5568;
}

.tab-btn:hover {
    border-color: #5a67d8;
    color: #5a67d8;
}

.tab-btn.active {
    background: #5a67d8;
    border-color: #5a67d8;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.upload-area {
    border: 3px dashed #cbd5e0;
    border-radius: 15px;
    padding: 50px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f7fafc;
}

.upload-area:hover {
    border-color: #5a67d8;
    background: #eef2ff;
}

.upload-area.dragover {
    border-color: #5a67d8;
    background: #eef2ff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.upload-area p {
    color: #4a5568;
    line-height: 1.6;
}

.file-types {
    font-size: 0.85rem;
    color: #718096 !important;
    margin-top: 10px;
}

.file-info {
    margin-top: 15px;
    padding: 12px 18px;
    background: #eef2ff;
    border-radius: 10px;
    color: #4a5568;
    display: none;
    align-items: center;
    gap: 10px;
}

.file-info.show {
    display: flex;
}

.file-info .file-name {
    flex: 1;
    font-weight: 500;
}

.file-info .file-size {
    color: #718096;
    font-size: 0.9rem;
}

.file-info .remove-file {
    background: none;
    border: none;
    color: #e53e3e;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 5px;
}

.convert-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s;
}

.convert-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(90, 103, 216, 0.4);
}

.convert-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

.convert-btn.loading {
    position: relative;
    color: transparent;
}

.convert-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.output-area {
    margin-top: 20px;
    display: none;
}

.output-area.show {
    display: block;
}

#extracted-text {
    width: 100%;
    height: 200px;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    background: #f7fafc;
}

#extracted-text:focus {
    outline: none;
    border-color: #5a67d8;
}

.copy-btn, .download-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 10px;
    margin-right: 10px;
    transition: all 0.3s;
}

.copy-btn {
    background: #48bb78;
    color: white;
}

.copy-btn:hover {
    background: #38a169;
}

.download-btn {
    background: #4299e1;
    color: white;
}

.download-btn:hover {
    background: #3182ce;
}

/* Guide Section */
.guide-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #e2e8f0;
}

.guide-section h2,
.features-section h2,
.formats-section h2,
.faq-section h2 {
    text-align: center;
    color: #2d3748;
    font-size: 1.4rem;
    margin-bottom: 25px;
}

.guide-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.guide-card {
    text-align: center;
    padding: 20px;
    background: #f7fafc;
    border-radius: 12px;
}

.guide-step {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    margin: 0 auto 15px;
}

.guide-card h3 {
    color: #2d3748;
    font-size: 1rem;
    margin-bottom: 10px;
}

.guide-card p {
    color: #718096;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Features Section */
.features-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e2e8f0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.feature-item {
    padding: 20px;
    background: #f7fafc;
    border-radius: 12px;
    text-align: center;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.feature-item h3 {
    color: #2d3748;
    font-size: 1rem;
    margin-bottom: 8px;
}

.feature-item p {
    color: #718096;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Formats Section */
.formats-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e2e8f0;
}

.formats-table {
    max-width: 400px;
    margin: 0 auto;
}

.format-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.format-row:last-child {
    border-bottom: none;
}

.format-from, .format-to {
    text-align: center;
    min-width: 100px;
}

.format-from strong, .format-to strong {
    display: block;
    color: #5a67d8;
    font-size: 1.1rem;
}

.format-from span {
    color: #718096;
    font-size: 0.8rem;
}

.format-arrow {
    color: #cbd5e0;
    font-size: 1.5rem;
}

/* FAQ Section */
.faq-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e2e8f0;
}

.faq-list {
    max-width: 600px;
    margin: 0 auto;
}

.faq-item {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
}

.faq-item summary {
    padding: 15px 20px;
    cursor: pointer;
    font-weight: 500;
    color: #2d3748;
    background: #f7fafc;
    list-style: none;
}

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

.faq-item summary::before {
    content: '+';
    margin-right: 10px;
    color: #5a67d8;
    font-weight: 700;
}

.faq-item[open] summary::before {
    content: '-';
}

.faq-item p {
    padding: 15px 20px;
    color: #4a5568;
    line-height: 1.8;
    font-size: 0.9rem;
}

/* Footer */
footer {
    background: #f7fafc;
    padding: 25px 20px;
    text-align: center;
    border-top: 1px solid #e2e8f0;
}

.footer-content p {
    color: #718096;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 15px 0;
}

.footer-nav a {
    color: #5a67d8;
    text-decoration: none;
    font-size: 0.85rem;
}

.footer-nav a:hover {
    text-decoration: underline;
}

.copyright {
    color: #a0aec0 !important;
    font-size: 0.8rem !important;
    margin-top: 15px !important;
}

/* Page Content (About, Contact, Privacy) */
.page-content {
    max-width: 650px;
    margin: 0 auto;
}

.content-section {
    margin-bottom: 35px;
}

.content-section h2 {
    color: #5a67d8;
    font-size: 1.3rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.content-section h3 {
    color: #2d3748;
    font-size: 1.1rem;
    margin: 20px 0 10px;
}

.content-section p {
    color: #4a5568;
    line-height: 1.8;
    margin-bottom: 12px;
}

.content-section ul {
    color: #4a5568;
    line-height: 1.8;
    margin-left: 25px;
    margin-bottom: 15px;
}

.content-section li {
    margin-bottom: 8px;
}

.content-section a {
    color: #5a67d8;
}

.feature-list {
    list-style: none;
    margin-left: 0 !important;
}

.feature-list li {
    padding: 15px;
    background: #f7fafc;
    border-radius: 10px;
    margin-bottom: 12px;
}

.feature-list li strong {
    color: #5a67d8;
    display: block;
    margin-bottom: 5px;
}

.feature-list li p {
    margin: 0;
    font-size: 0.9rem;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table th,
.info-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.info-table th {
    background: #f7fafc;
    color: #4a5568;
    font-weight: 500;
    width: 30%;
}

.info-table td {
    color: #2d3748;
}

/* Contact Form */
.contact-form {
    max-width: 500px;
    margin: 20px auto 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #4a5568;
    font-weight: 500;
    margin-bottom: 8px;
}

.required {
    color: #e53e3e;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #5a67d8;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(90, 103, 216, 0.4);
}

.notice-text {
    color: #718096;
    font-size: 0.9rem;
    background: #f7fafc;
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 3px solid #5a67d8;
    margin: 15px 0;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #2d3748;
    color: white;
    padding: 12px 25px;
    border-radius: 10px;
    font-size: 0.95rem;
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.error {
    background: #e53e3e;
}

.toast.success {
    background: #48bb78;
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.4rem;
    }

    .tabs {
        flex-direction: column;
    }

    .upload-area {
        padding: 30px 20px;
    }

    .upload-icon {
        font-size: 3rem;
    }

    .lang-switch {
        position: static;
        margin-top: 15px;
        justify-content: center;
    }

    .site-nav {
        flex-wrap: wrap;
        gap: 10px;
    }

    .guide-cards {
        grid-template-columns: 1fr;
    }

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

    .footer-nav {
        gap: 10px;
    }
}
