* {
    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(to bottom right, #eff6ff, #e0e7ff);
    min-height: 100vh;
    padding: 0;
}

/* ヘッダー */
.site-header {
    background-color: #111827;
    color: white;
    padding: 8px 16px;
    margin-bottom: 24px;
}

.header-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
    transition: opacity 0.2s;
}

.header-link:hover {
    opacity: 0.8;
}

.header-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px 24px 24px;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background: white;
    color: #1f2937;
    padding: 30px;
    text-align: center;
    border-radius: 8px 8px 0 0;
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #1f2937;
}

.header p {
    color: #6b7280;
    font-size: 1rem;
}

.upload-area {
    padding: 40px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-input-label {
    display: block;
    padding: 60px 20px;
    background: white;
    border: 3px dashed #4f46e5;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input-label:hover {
    background: #eef2ff;
    border-color: #4338ca;
}

.file-input-label.dragging {
    background: #e0e7ff;
    border-color: #4338ca;
}

.file-input {
    display: none;
}

.upload-icon {
    font-size: 3rem;
    color: #4f46e5;
    margin-bottom: 15px;
}

.upload-text {
    color: #1f2937;
    font-size: 1.1rem;
    margin-bottom: 5px;
    font-weight: 500;
}

.upload-subtext {
    color: #6c757d;
    font-size: 0.9rem;
}

.file-info {
    margin-top: 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    display: none;
}

.file-info.active {
    display: block;
}

.file-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 5px;
}

.file-size {
    color: #6b7280;
    font-size: 0.9rem;
}

.extract-button {
    margin-top: 20px;
    width: 100%;
    padding: 15px;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.extract-button:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

.extract-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.results-area {
    padding: 40px;
    display: none;
    background: white;
    border-radius: 0 0 8px 8px;
}

.results-area.active {
    display: block;
}

.results-header {
    margin-bottom: 30px;
}

.results-title {
    font-size: 1.5rem;
    color: #212529;
    margin-bottom: 10px;
}

.results-stats {
    display: flex;
    gap: 30px;
    margin-top: 15px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
}

.stat-value {
    color: #495057;
    font-weight: 600;
    font-size: 1.1rem;
}

.slide-container {
    margin-bottom: 25px;
    background: #f9fafb;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s ease;
    border: 1px solid #e5e7eb;
}

.slide-container:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.slide-header {
    padding: 15px 20px;
    background: #4f46e5;
    color: white;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.slide-number {
    font-size: 1rem;
    flex: 1;
}

.word-count {
    font-size: 0.85rem;
    opacity: 0.9;
}

.copy-slide-button {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.copy-slide-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.copy-slide-button.copied {
    background: #28a745;
    border-color: #28a745;
}

.slide-content {
    padding: 20px;
    background: white;
    line-height: 1.6;
    color: #374151;
}

.slide-content:empty::after {
    content: "（テキストなし）";
    color: #9ca3af;
    font-style: italic;
}

.error-message {
    display: none;
    padding: 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    margin-top: 20px;
}

.error-message.active {
    display: block;
}

.loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.loading.active {
    display: block;
}

.spinner {
    border: 4px solid #e5e7eb;
    border-top: 4px solid #4f46e5;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #6c757d;
    font-size: 1rem;
}

.copy-all-button {
    margin-bottom: 20px;
    padding: 12px 24px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-all-button:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.copy-all-button.copied {
    background: #20c997;
}

.download-images-button {
    margin-bottom: 20px;
    margin-left: 10px;
    padding: 12px 24px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-images-button:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

.download-images-button.copied {
    background: #20c997;
}

.images-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.images-header {
    margin-bottom: 20px;
}

.images-title {
    font-size: 1.3rem;
    color: #212529;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.image-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.image-item img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    background: #f8f9fa;
    padding: 10px;
}

.image-info {
    padding: 10px;
    background: #f8f9fa;
}

.image-name {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 8px;
    word-break: break-all;
}

.download-single-image {
    width: 100%;
    padding: 6px 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.download-single-image:hover {
    background: #218838;
}
