:root {
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-gradient: linear-gradient(135deg, #1e1b4b 0%, #312e81 25%, #3730a3 50%, #1e40af 75%, #1d4ed8 100%);
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --accent-primary: #3730a3;
    --accent-secondary: #1e40af;
    --accent-tertiary: #0ea5e9;
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --code-bg: #f1f5f9;
    --highlight-bg: #e0e7ff;
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --autify-dark: #1e1b4b;
    --autify-medium: #3730a3;
    --autify-light: #6366f1;
    --autify-accent: #0ea5e9;
    --visual-testing: #0ea5e9;
    --genetic-algo: #7c3aed;
    --graph-neural: #4f46e5;
    --reinforcement: #059669;
    --testing-orange: #ea580c;
    --ai-teal: #0d9488;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-primary: #020617;
    --bg-secondary: #0f172a;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 25%, #334155 50%, #475569 75%, #64748b 100%);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --accent-primary: #6366f1;
    --accent-secondary: #4f46e5;
    --accent-tertiary: #0ea5e9;
    --border-light: #1e293b;
    --border-medium: #334155;
    --code-bg: #1e293b;
    --highlight-bg: #1e40af;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --autify-dark: #1e293b;
    --autify-medium: #6366f1;
    --autify-light: #8b5cf6;
    --autify-accent: #22d3ee;
    --visual-testing: #22d3ee;
    --genetic-algo: #a855f7;
    --graph-neural: #6366f1;
    --reinforcement: #10b981;
    --testing-orange: #fb923c;
    --ai-teal: #14b8a6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 17px;
}

.theme-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 50px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.theme-toggle i {
    margin-right: 8px;
    color: var(--accent-primary);
    transition: transform 0.3s ease;
}

.theme-toggle:hover i {
    transform: rotate(180deg);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Hero Section */
.hero {
    background: var(--bg-gradient);
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::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="testing-pattern" width="30" height="30" patternUnits="userSpaceOnUse"><circle cx="15" cy="15" r="1.5" fill="rgba(255,255,255,0.08)"/><path d="M8,8 L22,22 M22,8 L8,22" stroke="rgba(255,255,255,0.04)" stroke-width="0.8"/><rect x="10" y="10" width="10" height="10" fill="none" stroke="rgba(255,255,255,0.06)" stroke-width="0.5"/><path d="M15,5 L15,25 M5,15 L25,15" stroke="rgba(255,255,255,0.03)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23testing-pattern)"/></svg>');
    opacity: 0.4;
}

.hero::after {
    content: '⚡';
    position: absolute;
    top: 15%;
    right: 10%;
    font-size: 4rem;
    opacity: 0.15;
    animation: float 12s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-25px) rotate(10deg); }
}

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

.original-post-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 32px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.original-post-link:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 16px;
    line-height: 1.1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 32px;
    font-weight: 400;
}

.hero-meta {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-item i {
    color: rgba(255, 255, 255, 0.9);
}

/* Article Content */
.article {
    background: var(--bg-secondary);
    margin: -40px auto 60px;
    padding: 60px;
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    position: relative;
    z-index: 2;
}

.article h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin: 48px 0 24px;
    font-weight: 700;
    position: relative;
    padding-left: 20px;
}

.article h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, var(--autify-medium), var(--visual-testing));
    border-radius: 2px;
}

.article h2:first-child {
    margin-top: 0;
}

.article h3 {
    font-size: 1.6rem;
    color: var(--text-primary);
    margin: 36px 0 18px;
    font-weight: 600;
}

.article h4 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin: 24px 0 12px;
    font-weight: 600;
}

.article p {
    margin-bottom: 24px;
    color: var(--text-primary);
    line-height: 1.8;
}

.article a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.article a:hover {
    color: var(--accent-secondary);
    border-bottom-color: var(--accent-secondary);
}

/* Intro Section */
.intro-section {
    margin-bottom: 40px;
}

/* Autify Intro Box */
.autify-intro-box {
    background: linear-gradient(135deg, var(--autify-dark), var(--autify-medium));
    color: white;
    padding: 32px;
    border-radius: 16px;
    margin: 32px 0;
    position: relative;
    overflow: hidden;
}

.autify-intro-box::before {
    content: '⚡';
    position: absolute;
    top: 20px;
    right: 32px;
    font-size: 2rem;
    opacity: 0.6;
}

.autify-intro-box h3 {
    font-size: 1.4rem;
    margin-bottom: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.autify-intro-box h3 i {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
}

.autify-intro-box p {
    line-height: 1.6;
    margin: 0;
}

/* Visual Testing Showcase */
.visual-testing-showcase {
    background: var(--bg-primary);
    border: 2px solid var(--visual-testing);
    border-radius: 16px;
    padding: 32px;
    margin: 48px 0;
    position: relative;
    overflow: hidden;
}

.visual-testing-showcase::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--visual-testing), var(--autify-medium));
}

.visual-testing-showcase h3 {
    font-size: 1.4rem;
    margin-bottom: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

.visual-testing-showcase h3 i {
    color: var(--visual-testing);
    font-size: 1.2rem;
}

.showcase-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    text-align: center;
}

.tech-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    transition: transform 0.3s ease;
}

.tech-image:hover {
    transform: scale(1.02);
}

.showcase-description {
    max-width: 800px;
    margin: 0 auto;
}

.showcase-description p {
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 20px;
    text-align: left;
}

.tech-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.highlight-item i {
    color: var(--visual-testing);
    font-size: 1.1rem;
}

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

/* Feature Locator Evolution */
.feature-locator-evolution {
    margin: 48px 0;
}

.feature-locator-evolution h3 {
    text-align: center;
    margin-bottom: 32px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.feature-locator-evolution h3 i {
    color: var(--genetic-algo);
}

.evolution-comparison {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 32px;
    align-items: center;
}

.evolution-stage {
    background: var(--bg-primary);
    border: 2px solid var(--border-medium);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
}

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

.evolution-stage.before {
    border-color: var(--warning-color);
}

.evolution-stage.after {
    border-color: var(--genetic-algo);
}

.evolution-stage h4 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 16px;
    font-weight: 600;
}

.stage-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.8rem;
    color: white;
}

.evolution-stage.before .stage-icon {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
}

.evolution-stage.after .stage-icon {
    background: linear-gradient(135deg, var(--genetic-algo), #d97706);
}

.evolution-stage ul {
    list-style: none;
    text-align: left;
}

.evolution-stage li {
    padding: 8px 0;
    color: var(--text-secondary);
    line-height: 1.5;
    position: relative;
    padding-left: 20px;
}

.evolution-stage li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--genetic-algo);
    font-weight: bold;
}

.evolution-arrow {
    font-size: 2rem;
    color: var(--genetic-algo);
    animation: pulse 2s infinite;
}

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

/* HTML Representation Box */
.html-representation-box {
    background: var(--bg-primary);
    border: 2px solid var(--graph-neural);
    border-radius: 16px;
    padding: 32px;
    margin: 48px 0;
    position: relative;
    overflow: hidden;
}

.html-representation-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--graph-neural), var(--autify-medium));
}

.html-representation-box h3 {
    font-size: 1.4rem;
    margin-bottom: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

.html-representation-box h3 i {
    color: var(--graph-neural);
    font-size: 1.2rem;
}

.gnn-pipeline {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 16px;
    align-items: center;
    margin: 32px 0;
}

.pipeline-step {
    text-align: center;
    padding: 20px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    transition: all 0.3s ease;
}

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

.step-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--graph-neural), var(--autify-medium));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: white;
    font-size: 1.4rem;
}

.pipeline-step h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 600;
}

.pipeline-step p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

.pipeline-arrow {
    font-size: 1.5rem;
    color: var(--graph-neural);
    text-align: center;
    font-weight: bold;
}

.tools-used {
    margin-top: 32px;
    text-align: center;
}

.tools-used h4 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 16px;
    font-weight: 600;
}

.tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.tool-tag {
    background: var(--graph-neural);
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tool-tag:hover {
    background: var(--autify-medium);
    transform: translateY(-2px);
}

/* RL Showcase */
.rl-showcase {
    background: var(--bg-primary);
    border: 2px solid var(--reinforcement);
    border-radius: 16px;
    padding: 32px;
    margin: 48px 0;
    position: relative;
    overflow: hidden;
}

.rl-showcase::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--reinforcement), var(--ai-teal));
}

.rl-showcase h3 {
    font-size: 1.4rem;
    margin-bottom: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

.rl-showcase h3 i {
    color: var(--reinforcement);
    font-size: 1.2rem;
}

.rl-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    text-align: center;
}

.rl-description {
    max-width: 800px;
    margin: 0 auto;
}

.rl-description p {
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 20px;
    text-align: left;
}

.rl-benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.benefit-item i {
    color: var(--reinforcement);
    font-size: 1.1rem;
}

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

.rl-demo {
    text-align: center;
}

.rl-gif {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--reinforcement);
    transition: transform 0.3s ease;
}

.rl-gif:hover {
    transform: scale(1.02);
}

.demo-caption {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 12px;
    font-style: italic;
}

/* Conclusion Box */
.conclusion-box {
    background: linear-gradient(135deg, var(--reinforcement), var(--ai-teal));
    color: white;
    padding: 32px;
    border-radius: 16px;
    margin: 48px 0;
    position: relative;
    overflow: hidden;
}

.conclusion-box::before {
    content: '🎯';
    position: absolute;
    top: 20px;
    right: 32px;
    font-size: 2rem;
    opacity: 0.6;
}

.conclusion-box h3 {
    font-size: 1.4rem;
    margin-bottom: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.conclusion-box h3 i {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
}

.conclusion-content p {
    line-height: 1.6;
    margin-bottom: 20px;
}

.key-innovations {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.innovation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.innovation-item i {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

.innovation-item span {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Contact Section */
.contact-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 24px;
    margin: 32px 0;
    text-align: center;
}

.contact-section h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.contact-section h3 i {
    color: var(--autify-medium);
}

.contact-section p {
    margin: 0;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Tags Section */
.tags-section {
    margin: 48px 0;
}

.tags-section h3 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tags-section h3 i {
    color: var(--autify-medium);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tag {
    background: var(--autify-medium);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tag:hover {
    background: var(--autify-light);
    transform: translateY(-2px);
}

/* Navigation */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 28px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 50px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    margin: 80px 0 60px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
}

.back-link:hover {
    background: var(--autify-medium);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.back-link i {
    transition: transform 0.3s ease;
}

.back-link:hover i {
    transform: translateX(-4px);
}

/* Footer */
.footer {
    text-align: center;
    padding: 60px 0;
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 14px;
    background: var(--bg-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .hero {
        padding: 80px 0 60px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .hero-meta {
        gap: 16px;
        flex-direction: column;
        align-items: center;
    }
    
    .article {
        padding: 32px 24px;
        margin: -20px auto 40px;
    }
    
    .article h2 {
        font-size: 1.6rem;
        margin: 36px 0 20px;
    }
    
    .tech-highlights {
        grid-template-columns: 1fr;
    }
    
    .rl-benefits {
        grid-template-columns: 1fr;
    }
    
    .evolution-comparison {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .evolution-arrow {
        transform: rotate(90deg);
    }
    
    .gnn-pipeline {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .pipeline-arrow {
        transform: rotate(90deg);
    }
    
    .key-innovations {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .autify-intro-box, .conclusion-box {
        padding: 24px;
    }
    
    .visual-testing-showcase, .html-representation-box, .rl-showcase {
        padding: 24px;
    }
    
    .contact-section {
        padding: 20px;
    }
    
    .theme-toggle {
        top: 16px;
        right: 16px;
        padding: 10px 16px;
    }
    
    body {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .article {
        padding: 24px 16px;
    }
    
    .autify-intro-box, .conclusion-box {
        padding: 20px;
    }
    
    .visual-testing-showcase, .html-representation-box, .rl-showcase {
        padding: 20px;
    }
    
    .contact-section {
        padding: 16px;
    }
    
    .tags {
        gap: 8px;
    }
    
    .tag {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .tool-tags {
        gap: 6px;
    }
    
    .tool-tag {
        font-size: 11px;
        padding: 4px 8px;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 32px;
    }
    
    .article {
        padding: 80px;
    }
    
    .tech-highlights {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .rl-benefits {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .key-innovations {
        grid-template-columns: repeat(2, 1fr);
    }
}
