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

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --success-color: #10b981;
    --error-color: #ef4444;
    --border-color: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --bg-gray: #f9fafb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-gray);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 1rem;
}

.description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    max-width: 700px;
    margin: 0 auto 1.5rem;
}

.header-features {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.feature-badge {
    background: #eff6ff;
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #dbeafe;
}

/* Preview Notice */
.preview-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    color: #1e40af;
    font-size: 0.95rem;
    line-height: 1.6;
}

.preview-notice-icon {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.preview-notice-icon svg {
    display: block;
}

.preview-notice-content {
    flex: 1;
}

.preview-notice-content strong {
    font-weight: 600;
    color: #1e3a8a;
}

.preview-notice-content a {
    color: #2563eb;
    text-decoration: underline;
    font-weight: 500;
}

.preview-notice-content a:hover {
    color: #1d4ed8;
}

/* Card */
.card {
    background: white;
    border-radius: 0.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* Upload Section */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--bg-gray);
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.upload-label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
}

.upload-label svg {
    color: var(--primary-color);
}

.upload-label span {
    font-size: 1rem;
}

.upload-hint {
    font-size: 0.875rem !important;
    color: var(--text-secondary);
}

.file-list {
    margin-top: 1rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-gray);
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.file-item-name {
    font-weight: 500;
    color: var(--text-primary);
}

.file-item-size {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

.file-item-remove {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem 0.5rem;
}

/* Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.required {
    color: var(--error-color);
}

input[type="text"],
select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

small {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 400;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.5rem;
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background: #eff6ff;
}

/* Results */
.code-file {
    margin-bottom: 2rem;
}

.code-file-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.code-file-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.code-file-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.code-file-actions {
    display: flex;
    gap: 0.5rem;
}

.code-preview {
    position: relative;
    background: #f6f8fa;
    border-radius: 0.375rem;
    overflow: hidden;
    margin-bottom: 1rem;
}

.code-preview pre {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
}

.code-preview code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.btn-copy,
.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy {
    background: var(--primary-color);
}

.btn-copy:hover {
    background: var(--primary-hover);
}

.btn-download {
    background: var(--success-color);
}

.btn-download:hover {
    background: #059669;
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Error */
.error-message {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    white-space: pre-wrap;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-size: 0.875rem;
}

/* Info Sections */
.info-section {
    margin: 3rem 0;
    text-align: center;
}

.info-section h2 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

/* Steps Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.step-card {
    padding: 1.5rem;
    text-align: center;
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.step-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Benefits Grid */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.benefit-card {
    background: white;
    padding: 2rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.benefit-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.benefit-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.benefit-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.benefit-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Footer */
footer {
    margin-top: 4rem;
    padding: 3rem 0 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
    padding-right: 1rem;
    padding-left: 1rem;
    text-align: left;
    flex-wrap: nowrap;
}

.footer-section {
    flex: 1;
    min-width: 180px;
    padding-right: 1rem;
}

.footer-section h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.footer-section p {
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--primary-color);
    text-decoration: none;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-style: italic;
}

/* Social Links Row */
.social-links-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 1rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.social-link-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.social-link-item:hover {
    transform: translateY(-2px);
}

.social-link-item:hover .platform-name {
    color: var(--primary-color);
}

/* Social Links (old vertical - keep for compatibility) */
.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.social-link a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.social-link a:hover .platform-name {
    color: var(--primary-color);
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--text-secondary);
    background: var(--bg-gray);
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.social-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.social-icon:hover {
    color: var(--primary-color);
    background: #eff6ff;
    transform: translateY(-2px);
}

.social-icon svg {
    width: 18px;
    height: 18px;
}

.platform-name {
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 1rem 0.5rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1.125rem;
    }

    .description {
        font-size: 0.9375rem;
    }

    .header-features {
        gap: 0.5rem;
    }

    .feature-badge {
        font-size: 0.8125rem;
        padding: 0.4rem 0.75rem;
    }

    .card {
        padding: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .upload-area {
        padding: 2rem 1rem;
    }

    .info-section h2 {
        font-size: 1.5rem;
    }

    .steps-grid,
    .benefits-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-links {
        grid-template-columns: 1fr;
        text-align: center;
    }
}
