/* Modern CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette inspired by PosterGenerator.org */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;

    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-white: #ffffff;

    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Hero Section */
.hero {
    background:
        linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.8) 100%),
        url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80') center/cover;
    padding: 6rem 0 8rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%),
        linear-gradient(180deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.3) 100%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, var(--bg-primary) 0%, transparent 100%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: var(--text-white);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    color: var(--text-white);
    margin-bottom: 1.5rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2.5vw, 1.25rem);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.2);
}

/* Main Input Section */
.main-input-section {
    max-width: 700px;
    margin: 0 auto 3rem;
}

/* Template Selection */
.template-selection {
    margin-bottom: 1.5rem;
}

.template-label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.1rem;
}

.template-tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem;
    border-radius: var(--radius-xl);
    backdrop-filter: blur(10px);
}

.template-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 0.5rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-lg);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.template-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.template-tab.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.tab-icon {
    font-size: 1.25rem;
}

.tab-text {
    font-weight: 500;
    white-space: nowrap;
}

/* Scenario Examples */
.scenario-examples {
    margin-bottom: 1.5rem;
}

.examples-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.examples-title {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
}

.examples-cards {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.example-mini-card {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.example-mini-card:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.example-mini-card:active {
    transform: scale(0.95);
}

.mini-icon {
    font-size: 1rem;
}

.mini-text {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    white-space: nowrap;
}

.input-group {
    margin-bottom: 1.5rem;
}

.main-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-xl);
    font-size: 1.125rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.main-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3), 0 8px 30px rgba(0, 0, 0, 0.15);
}

.main-input::placeholder {
    color: var(--text-muted);
}

.input-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.char-count {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.template-hint {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

/* Main CTA Button */
.main-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: var(--text-white);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-xl);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.main-cta-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.main-cta-btn:active {
    transform: translateY(0);
}

.main-cta-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-sm);
}

.btn-icon {
    font-size: 1.25rem;
}

/* Result Section */
.result-section {
    margin-top: 3rem;
    display: none;
}

.result-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    text-align: left;
}

.result-header {
    margin-bottom: 1.5rem;
}

.result-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.result-content {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-light);
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.copy-btn, .new-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover, .new-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Loading Animation Styles */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

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

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

.loading-dots {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.loading-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dot:nth-child(3) { animation-delay: 0s; }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.loading-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.loading-subtext {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Error Message Styles */
.error-message {
    padding: 1.5rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-lg);
    color: #dc2626;
    text-align: center;
}

.error-message p {
    margin: 0.5rem 0;
}

/* Optimization Result Styles */
.optimization-result {
    padding: 1rem 0;
}

.optimization-result p {
    margin: 0.5rem 0;
}

.optimized-text {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
    font-style: italic;
    line-height: 1.6;
}

/* Advertisement Section */
.ad-section {
    margin-top: 2rem;
    display: none; /* Initially hidden, will show when result is displayed */
}

.ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.ad-container iframe {
    border-radius: var(--radius-md);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Showcase Container (within Hero section) */
.showcase-container {
    margin-top: 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border-radius: var(--radius-2xl);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.showcase-container .section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.showcase-container .section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.showcase-container .section-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Features Section */
.features-section {
    padding: 6rem 0;
    background: var(--bg-secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

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

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

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

.feature-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* FAQ Section */
.faq-section {
    padding: 6rem 0;
    background: var(--bg-primary);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.faq-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.faq-question {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.faq-answer {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}



/* Video Showcase Section */
.showcase-container {
    padding: 6rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
    overflow: hidden;
}

.showcase-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23000" opacity="0.02"/><circle cx="75" cy="75" r="1" fill="%23000" opacity="0.02"/><circle cx="50" cy="10" r="1" fill="%23000" opacity="0.02"/><circle cx="10" cy="60" r="1" fill="%23000" opacity="0.02"/><circle cx="90" cy="40" r="1" fill="%23000" opacity="0.02"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.showcase-section {
    padding: 6rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
    overflow: hidden;
}

.showcase-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23000" opacity="0.02"/><circle cx="75" cy="75" r="1" fill="%23000" opacity="0.02"/><circle cx="50" cy="10" r="1" fill="%23000" opacity="0.02"/><circle cx="10" cy="60" r="1" fill="%23000" opacity="0.02"/><circle cx="90" cy="40" r="1" fill="%23000" opacity="0.02"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

.video-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
    width: 100%;
    position: relative;
}

.video-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.video-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.video-card:hover::before {
    opacity: 1;
}

.video-container {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.video-container video,
.video-container iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    border: none;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.video-card:hover .video-container video,
.video-card:hover .video-container iframe {
    transform: scale(1.05);
}

.video-info {
    padding: 2rem;
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.video-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.video-prompt {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.video-prompt strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Prompt Templates Section */
.templates-section {
    padding: 6rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.templates-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="templateGrain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="30" cy="30" r="1" fill="%23fff" opacity="0.05"/><circle cx="70" cy="70" r="1" fill="%23fff" opacity="0.05"/><circle cx="50" cy="15" r="1" fill="%23fff" opacity="0.05"/><circle cx="15" cy="65" r="1" fill="%23fff" opacity="0.05"/><circle cx="85" cy="45" r="1" fill="%23fff" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23templateGrain)"/></svg>');
    pointer-events: none;
}

.templates-content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.templates-section .template-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.templates-section .template-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.templates-section .template-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.templates-section .template-card:hover::before {
    opacity: 1;
}

.templates-section .template-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.templates-section .template-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.templates-section .template-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.templates-section .template-body {
    color: var(--text-secondary);
    line-height: 1.6;
}

.templates-section .template-formula {
    background: rgba(102, 126, 234, 0.1);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    border-left: 4px solid #667eea;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.templates-section .template-example {
    background: rgba(118, 75, 162, 0.1);
    padding: 1rem;
    border-radius: var(--radius-lg);
    border-left: 4px solid #764ba2;
    margin-bottom: 1.5rem;
}

.templates-section .example-label {
    font-weight: 600;
    color: var(--text-primary);
}

.templates-section .example-text {
    color: var(--text-secondary);
    font-style: italic;
}

.templates-section .template-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.templates-section .tag {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

/* Video Prompt Guide Section */
.guide-section {
    padding: 6rem 0;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    position: relative;
    overflow: hidden;
}

.guide-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="guideGrain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="35" cy="35" r="1" fill="%23fff" opacity="0.05"/><circle cx="65" cy="65" r="1" fill="%23fff" opacity="0.05"/><circle cx="45" cy="20" r="1" fill="%23fff" opacity="0.05"/><circle cx="20" cy="70" r="1" fill="%23fff" opacity="0.05"/><circle cx="80" cy="50" r="1" fill="%23fff" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23guideGrain)"/></svg>');
    pointer-events: none;
}

.guide-content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.guide-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.guide-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.guide-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.guide-card:hover::before {
    opacity: 1;
}

.guide-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.guide-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.guide-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.guide-body {
    color: var(--text-secondary);
    line-height: 1.6;
}

.guide-text {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.guide-example {
    background: rgba(79, 172, 254, 0.1);
    padding: 1rem;
    border-radius: var(--radius-lg);
    border-left: 4px solid #4facfe;
    margin-top: 1rem;
}

.example-label {
    font-weight: 600;
    color: var(--text-primary);
}

.example-text {
    color: var(--text-secondary);
    font-style: italic;
}

.framework-formula {
    background: rgba(102, 126, 234, 0.1);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    border-left: 4px solid #667eea;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.framework-elements {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.element-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.element-item strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.5rem;
}

.element-example {
    font-style: italic;
    color: var(--text-secondary);
    background: rgba(79, 172, 254, 0.1);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

.technique-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.technique-item {
    background: rgba(255, 255, 255, 0.5);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.technique-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
}

.technique-desc {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.technique-example {
    background: rgba(79, 172, 254, 0.1);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: var(--text-white);
    padding: 2rem 0;
    text-align: center;
}

.footer-text {
    font-size: 0.95rem;
    opacity: 0.8;
    margin: 0;
}

/* Optimization Result Styles */
.optimization-result {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-light);
}

.optimized-text {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-primary);
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.optimization-meta {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 0.875rem;
    display: none; /* 隐藏技术元数据 */
}

/* Error Message Styles */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    color: #dc2626;
}

.error-message p {
    margin: 0.5rem 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
        max-width: 900px;
    }

    .feature-card {
        padding: 1.75rem;
    }

    .video-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .video-card {
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 3rem 0 4rem;
    }

    .main-input-section {
        max-width: 100%;
    }

    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 0 1.5rem;
    }

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

    .result-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .copy-btn, .new-btn {
        justify-content: center;
    }

    .ad-container {
        padding: 1rem;
    }

    .features-section {
        padding: 4rem 0;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .faq-section {
        padding: 4rem 0;
    }

    .faq-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .showcase-container {
        margin-top: 2rem;
        padding: 1.5rem;
    }

    .showcase-container .section-title {
        font-size: 1.75rem;
    }
}

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

    .hero {
        padding: 2rem 0 3rem;
    }

    .result-card {
        padding: 1.5rem;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .faq-item {
        padding: 1.5rem;
    }

    .showcase-container {
        margin-top: 1.5rem;
        padding: 1rem;
    }

    .showcase-container .section-title {
        font-size: 1.5rem;
    }

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

    .video-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 0.5rem;
    }
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
}

/* Main Content */
.main-content {
    padding: 4rem 0;
}

/* Optimizer Card */
.optimizer-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.optimizer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

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

.card-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.card-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* Input Section */
.input-section {
    margin-bottom: 2rem;
}

.input-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.prompt-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

.prompt-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: var(--bg-primary);
}

.prompt-input::placeholder {
    color: var(--text-muted);
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.char-count {
    font-weight: 500;
}

.shortcut-hint {
    font-style: italic;
}

/* Optimize Button */
.optimize-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem 2rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.optimize-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.optimize-btn:active {
    transform: translateY(0);
}

.optimize-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-sm);
}

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

/* Result Container */
.result-container {
    margin-top: 2rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
    display: none;
}

.result-header {
    padding: 1.25rem 1.5rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
}

.result-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.result-content {
    padding: 1.5rem;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
}

/* Optimization Result Styles */
.optimization-result {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--border-light);
}

.optimized-text {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-primary);
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.optimization-meta {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Error Message Styles */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    color: #dc2626;
}

.error-message p {
    margin: 0.5rem 0;
}



/* Footer */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.footer-text {
    font-size: 0.95rem;
    opacity: 0.8;
    margin: 0;
}

/* Additional Responsive Design */
@media (max-width: 900px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 0 1.5rem;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 3rem 0;
    }

    .main-content {
        padding: 2rem 0;
    }

    .optimizer-card {
        padding: 1.5rem;
    }

    .main-input-section {
        max-width: 100%;
        padding: 0 1rem;
    }

    .template-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .template-tab {
        flex-direction: row;
        justify-content: center;
        padding: 1rem;
    }

    .tab-text {
        margin-left: 0.5rem;
    }

    .scenario-examples {
        margin-bottom: 1rem;
    }

    .examples-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .examples-cards {
        justify-content: center;
    }

    .example-mini-card {
        padding: 0.5rem 0.625rem;
        font-size: 0.8rem;
    }

    .examples-title {
        font-size: 0.9rem;
    }

    .video-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }

    .video-container {
        height: 200px;
    }

    .video-info {
        padding: 1.5rem;
    }

    .showcase-section {
        padding: 4rem 0;
    }

    .templates-section {
        padding: 4rem 0;
    }

    .templates-section .template-card {
        padding: 2rem;
    }

    .templates-section .template-title {
        font-size: 1.25rem;
    }

    .templates-section .template-tags {
        gap: 0.375rem;
    }

    .templates-section .tag {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
    }

    .guide-section {
        padding: 4rem 0;
    }

    .guide-card {
        padding: 2rem;
    }

    .guide-title {
        font-size: 1.25rem;
    }

    .technique-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .framework-elements {
        gap: 1rem;
    }

    .element-item {
        padding: 0.75rem;
    }
}

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

    .optimizer-card {
        padding: 1rem;
    }

    .hero {
        padding: 2rem 0;
    }
}

/* Floating particles animation */
.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.floating-elements::before,
.floating-elements::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.floating-elements::before {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-elements::after {
    top: 60%;
    right: 15%;
    animation-delay: 3s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.8;
    }
}

/* 加载动画样式 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    margin-bottom: 20px;
    position: relative;
}

.loading-spinner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-dots {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.loading-dot {
    width: 8px;
    height: 8px;
    background: #ffffff;
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dot:nth-child(3) { animation-delay: 0s; }

.loading-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.loading-subtext {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* 动画关键帧 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 脉冲动画 */
.loading-pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* 按钮加载状态 */
.optimize-btn.loading {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: not-allowed;
    position: relative;
}

.optimize-btn.loading .btn-text {
    opacity: 0.7;
}

.optimize-btn.loading .btn-icon {
    animation: spin 1s linear infinite;
}

/* 响应式设计优化 */
@media (max-width: 768px) {
    .hero {
        padding: 4rem 0 6rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }

    .template-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .template-tab {
        flex-direction: row;
        justify-content: center;
        padding: 1rem;
    }

    .examples-cards {
        justify-content: center;
    }

    .video-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

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

    .templates-content {
        grid-template-columns: 1fr;
    }

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

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

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

    .showcase-container {
        padding: 1.5rem;
        margin-left: -1.5rem;
        margin-right: -1.5rem;
        width: calc(100% + 3rem);
    }
}

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

    .hero {
        padding: 3rem 0 5rem;
    }

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

    .main-input-section {
        max-width: 100%;
    }

    .result-card {
        padding: 1.5rem;
    }

    .result-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

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