* {
    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, #0a0e27 0%, #1a1f3a 100%);
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.6;
}

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

.header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1.1rem;
    color: #a0aec0;
}

.config-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.config-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.config-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.config-icon {
    font-size: 1.2rem;
}

.config-arrow {
    font-size: 0.8rem;
    color: #a0aec0;
    transition: transform 0.3s ease;
}

.config-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 2rem;
}

.config-body.open {
    max-height: 600px;
    padding: 0 2rem 1.5rem;
}

.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.config-item.full-width {
    grid-column: 1 / -1;
}

.config-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #a0aec0;
}

.config-select,
.config-input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 0.7rem 1rem;
    color: #ffffff;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, background 0.2s ease;
    outline: none;
    width: 100%;
}

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

.config-select:focus,
.config-input:focus {
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.config-select option {
    background: #1a1f3a;
    color: #ffffff;
}

.api-key-wrapper {
    display: flex;
    gap: 0.5rem;
}

.api-key-wrapper .config-input {
    flex: 1;
}

.toggle-visibility {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 0 0.75rem;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toggle-visibility:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(102, 126, 234, 0.5);
}

.config-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
}

.config-status {
    display: none;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.config-status.success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.config-status.error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.upload-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 3rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.upload-area {
    border: 2px dashed rgba(102, 126, 234, 0.5);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(102, 126, 234, 0.05);
}

.upload-area:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.upload-area.drag-over {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.15);
    transform: scale(1.02);
}

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

.upload-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.upload-hint {
    color: #a0aec0;
    font-size: 0.9rem;
}

.file-preview {
    margin-top: 1.5rem;
}

.file-preview-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: rgba(102, 126, 234, 0.1);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid rgba(102, 126, 234, 0.3);
}

.file-icon-large {
    font-size: 4rem;
    filter: drop-shadow(0 4px 8px rgba(102, 126, 234, 0.3));
}

.file-info-large {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-name-large {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
}

.file-size-large {
    font-size: 0.95rem;
    color: #a0aec0;
}

.upload-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

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

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

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
}

.results-section {
    display: none;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: #ffffff;
}

.result-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    max-width: 900px;
    margin: 0 auto;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.result-card.error {
    border-color: rgba(239, 68, 68, 0.3);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge.success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.status-badge.error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    padding: 1rem;
    border-radius: 8px;
    color: #ef4444;
}

.card-section {
    margin-bottom: 1.5rem;
}

.section-label {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #ffffff;
}

.selling-points {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.point-tag {
    background: rgba(102, 126, 234, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.point-time {
    background: rgba(102, 126, 234, 0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.point-text {
    color: #ffffff;
}

.point-emphasis {
    color: #a0aec0;
    font-size: 0.85rem;
}

.script-timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -2rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    background: #667eea;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: -1.45rem;
    top: 1.5rem;
    width: 2px;
    height: calc(100% - 1rem);
    background: rgba(102, 126, 234, 0.3);
}

.timeline-content h5 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: #667eea;
}

.timeline-content p {
    font-size: 0.9rem;
    color: #cbd5e0;
    margin-bottom: 0.25rem;
}

.quality-scores {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.score-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.score-label {
    min-width: 80px;
    font-size: 0.9rem;
    color: #a0aec0;
}

.score-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.score-value {
    min-width: 50px;
    text-align: right;
    font-weight: 600;
    color: #ffffff;
}

.score-item.overall .score-fill {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.improvement-suggestions {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
}

.improvement-suggestions h5 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: #667eea;
}

.improvement-suggestions ul {
    list-style: none;
    padding-left: 0;
}

.improvement-suggestions li {
    font-size: 0.9rem;
    color: #cbd5e0;
    padding: 0.25rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.improvement-suggestions li::before {
    content: '💡';
    position: absolute;
    left: 0;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 39, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    text-align: center;
    max-width: 500px;
    padding: 2rem;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}

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

.loading-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.loading-hint {
    color: #a0aec0;
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.progress-text {
    color: #a0aec0;
    font-size: 0.9rem;
}

.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    z-index: 1001;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: rgba(16, 185, 129, 0.9);
    color: #ffffff;
}

.notification.error {
    background: rgba(239, 68, 68, 0.9);
    color: #ffffff;
}

.notification.warning {
    background: rgba(245, 158, 11, 0.9);
    color: #ffffff;
}

.notification-icon {
    font-size: 1.2rem;
}

.notification-text {
    font-weight: 500;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .page-title {
        font-size: 2rem;
    }

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

    .file-preview-content {
        flex-direction: column;
        text-align: center;
    }

    .upload-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .result-card {
        padding: 1.5rem;
    }
}
