* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    /* Background managed by HTML structure for better performance */
    min-height: 100vh;
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #2d3748;
    background-color: #CCE4FF;
}

.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation-name: floatUp;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    20% {
        opacity: var(--bubble-opacity);
    }
    80% {
        opacity: var(--bubble-opacity);
    }
    100% {
        transform: translateY(-120vh) translateX(-30px);
        opacity: 0;
    }
}

.title-link {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.title-link:hover {
    color: #005bea;
}

/* Container Styles */
.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 50px;
    max-width: 500px; /* Default for subpages */
    width: 100%;
    text-align: center; /* Default center for subpages */
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    transition: max-width 0.3s ease;
}

/* Responsive background image optimization */
@media (max-width: 768px) {
    /* Blog container adjustments on mobile devices */
    .blog-container {
        max-width: 90%; /* Reduce width on mobile devices */
        padding: 30px 20px;
    }
}

/* Home Page Specific Layout */
.home-container {
    max-width: 950px; /* Wider for home page */
    display: flex;
    align-items: center;
    text-align: left;
    gap: 60px;
    padding: 60px;
}

/* Blog Container for wide article display */
.blog-container {
    max-width: 95%; /* Increase width to 95%, maximize available space */
    width: 1200px; /* Set fixed maximum width */
    padding: 40px 50px; /* Adjust padding to maintain proper left and right spacing */
    margin: 0 auto;
    text-align: left;
}

/* Post page specific container - wider than default blog-container */
.container.blog-container.post-page-container {
    max-width: 95% !important;
    width: 1400px !important; /* Wider than default blog-container */
    padding: 40px 60px !important; /* Slightly more padding for larger container */
    margin: 0 auto;
    text-align: left;
}

/* Responsive adjustments for post page */
@media (max-width: 1400px) {
    .container.blog-container.post-page-container {
        max-width: 95% !important;
        width: auto !important;
    }
}

@media (max-width: 768px) {
    .container.blog-container.post-page-container {
        max-width: 95% !important;
        padding: 30px 20px !important;
    }
}

/* Responsive blog container */
@media (max-width: 1200px) {
    .blog-container {
        max-width: 95%; /* Keep 95% width on medium screens */
        width: auto; /* Allow width to adapt automatically */
    }
}

@media (max-width: 768px) {
    .blog-container {
        max-width: 100%; /* Use 100% width on mobile devices */
        padding: 30px 20px; /* Reduce padding on mobile devices */
    }
}

/* Profile Section (Left) */
.profile-section {
    flex: 1;
    text-align: center;
    min-width: 300px;
}

/* Links Section (Right) */
.links-section {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    gap: 25px;
    width: 100%;
}

/* Responsive Design */
@media (max-width: 850px) {
    .home-container {
        flex-direction: column;
        max-width: 700px;
        gap: 40px;
        padding: 40px 30px;
    }
    
    .repo-container {
        max-width: 700px;
    }
    
    .links-section {
        width: 100%;
    }
}

/* Component Styles */
.avatar {
    width: clamp(84px, 14vw, 120px);
    height: clamp(84px, 14vw, 120px);
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    background: linear-gradient(135deg, #66a6ff, #005bea);
    border: 3px solid rgba(255, 255, 255, 0.85);
    margin: 0 auto 25px;
    display: block;
    box-shadow: 0 10px 30px rgba(102, 166, 255, 0.32), 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.avatar:hover {
    transform: rotate(10deg) scale(1.05);
}

h1 {
    color: #2d3748;
    font-size: 2rem;
    margin-bottom: 8px;
    font-weight: 700;
    text-align: center;
}

/* Center-aligned text in blog page title areas */
.blog-index-container h1,
.blog-index-container .subtitle,
h1,
.subtitle {
    text-align: center;
}

/* Keep titles inside card links left-aligned */
.card-content h1,
.card-content h2,
.card-content h3,
.card-content h4,
.card-content h5,
.card-content h6 {
    text-align: left;
}

/* Center-aligned footer text */
.footer {
    text-align: center;
}

/* Center-aligned content on other blog pages */
.bio {
    text-align: center;
}

.bio p {
    text-align: center;
}

.subtitle {
    color: #005bea;
    font-size: 1rem;
    margin-bottom: 20px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.bio {
    color: #4a5568;
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 30px;
}

.decorative-line {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #89f7fe, #66a6ff);
    margin: 0 auto 30px;
    border-radius: 2px;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.tag {
    background: #f0f9ff;
    color: #005bea;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid #bae6fd;
    transition: all 0.3s ease;
    cursor: default;
}

.tag:hover {
    background: #005bea;
    color: white;
    transform: translateY(-2px);
    border-color: #005bea;
}

/* Link Cards Styles */
.link-card {
    display: flex;
    align-items: center;
    background: #ffffff;
    padding: 25px;
    border-radius: 16px;
    text-decoration: none;
    color: #2d3748;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.link-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(102, 166, 255, 0.15);
    border-color: #66a6ff;
    background: #f8fbff;
}

.card-icon {
    font-size: 2.2rem;
    margin-right: 20px;
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    transition: transform 0.3s ease;
}

.link-card:hover .card-icon {
    transform: scale(1.1) rotate(-5deg);
    background: linear-gradient(135deg, #66a6ff, #005bea);
}

.card-content {
    flex: 1;
    text-align: left;
}

.card-content h3 {
    font-size: 1.25rem;
    color: #2d3748;
    margin-bottom: 6px;
    font-weight: 700;
}

.card-content p {
    font-size: 0.9rem;
    color: #718096;
    line-height: 1.4;
}

.card-arrow {
    font-size: 1.5rem;
    font-weight: bold;
    color: #cbd5e0;
    margin-left: 15px;
    transition: all 0.3s ease;
}

.link-card:hover .card-arrow {
    color: #005bea;
    transform: translateX(5px);
}

/* Legacy Button Styles (for subpages) */
.nav-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #66a6ff, #005bea);
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 166, 255, 0.4);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 166, 255, 0.5);
}

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

.footer {
    margin-top: 30px;
    color: #a0aec0;
    font-size: 0.85rem;
}

.footer code {
    background: #edf2f7;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    color: #005bea;
}

/* Blog index page specific styles */
.blog-index-container {
    max-width: 950px; /* Consistent with home page */
    width: 90%;
    margin: 0 auto;
    text-align: center; /* Center-aligned title area */
}

.blog-index-container .card-content {
    text-align: left; /* Keep text inside card links left-aligned */
}

/* Repository Page Styles */
.repo-container {
    max-width: 950px; /* Consistent with home page */
    width: 90%;
    margin: 0 auto;
    text-align: left; /* Left-aligned title area */
}

.repo-container .card-content {
    text-align: left; /* Keep text inside card links left-aligned */
}

/* Keep repository page title area center-aligned */
.repo-container h1,
.repo-container .subtitle {
    text-align: center;
}

/* Blog Container for wide article display */
.blog-container {
    max-width: 800px; /* Wider for blog posts */
    padding: 50px;
    margin: 0 auto;
    text-align: left;
}

.repo-section {
    margin-bottom: 30px;
    text-align: center; /* Center-aligned content on repository page */
}

.section-title {
    font-size: 1.2rem;
    color: #2d3748;
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 4px solid #005bea;
    font-weight: 600;
}

.repo-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.repo-card {
    padding: 20px;
}

.repo-card .card-icon {
    font-size: 1.8rem;
    width: 50px;
    height: 50px;
}

.empty-state {
    background: #f7fafc;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    color: #a0aec0;
    border: 2px dashed #e2e8f0;
}

/* Social Links in Repository Page */
.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    background: #f7fafc;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: #ebf8ff;
    color: #005bea;
    transform: translateY(-2px);
}

/* Markdown Content Styles */
.post-content {
    text-align: left;
    line-height: 1.8;
    color: #2d3748;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    color: #1a202c;
    font-weight: 700;
    margin: 2rem 0 1rem 0;
    line-height: 1.4;
}

.post-content h1 {
    font-size: 2rem;
    border-bottom: 3px solid #005bea;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.post-content h2 {
    font-size: 1.6rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.3rem;
    margin-bottom: 1.2rem;
}

.post-content h3 {
    font-size: 1.3rem;
    color: #005bea;
}

.post-content h4 {
    font-size: 1.1rem;
    color: #4a5568;
}

.post-content p {
    margin-bottom: 1.2rem;
    font-size: 1rem;
}

.post-content p:last-child {
    margin-bottom: 0;
}

/* Code blocks and inline code */
.post-content pre {
    background: #1a202c;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid #2d3748;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-content code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background: #f7fafc;
    color: #e53e3e;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    border: 1px solid #e2e8f0;
}

.post-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
    border: none;
    font-size: 0.95em;
}

/* Lists */
.post-content ul,
.post-content ol {
    margin: 1rem 0 1.5rem 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.post-content ul li {
    list-style-type: disc;
}

.post-content ol li {
    list-style-type: decimal;
}

/* Blockquotes */
.post-content blockquote {
    background: #f7fafc;
    border-left: 4px solid #005bea;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
    color: #4a5568;
    font-style: italic;
}

/* Links */
.post-content a {
    color: #005bea;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom-color 0.3s ease;
}

.post-content a:hover {
    border-bottom-color: #005bea;
    color: #004494;
}

/* Images */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 1rem auto;
    display: block;
}

/* Center images with #center tag in Markdown */
.post-content img[src*="#center"] {
    text-align: center;
    margin: 1rem auto;
    display: block;
}

/* Tables */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-content th,
.post-content td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.post-content th {
    background: #f7fafc;
    font-weight: 600;
    color: #2d3748;
}

.post-content tr:hover {
    background: #f7fafc;
}

/* Horizontal rules */
.post-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, #005bea, #66a6ff);
    margin: 2rem 0;
    border-radius: 1px;
}

/* Mathematical expressions */
.post-content .katex {
    font-size: 1.1em;
}

.post-content .katex-display {
    margin: 1.5rem 0;
    text-align: center;
}

/* Emphasis */
.post-content strong {
    font-weight: 700;
    color: #1a202c;
}

.post-content em {
    font-style: italic;
    color: #4a5568;
}

/* Strikethrough */
.post-content del {
    text-decoration: line-through;
    color: #a0aec0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .post-content {
        font-size: 0.95rem;
    }
    
    .post-content h1 {
        font-size: 1.7rem;
    }
    
    .post-content h2 {
        font-size: 1.4rem;
    }
    
    .post-content pre {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .post-content ul,
    .post-content ol {
        margin-left: 1.5rem;
    }
}

/* Responsive design for article pages */
@media (max-width: 1200px) {
    .repo-container {
        max-width: 95%;
        width: 95%;
    }
}

@media (max-width: 768px) {
    .repo-container {
        max-width: 98%;
        width: 98%;
        padding: 30px 20px;
        margin: 10px auto;
    }
    
    .post-content {
        padding: 0;
    }
    
    .post-content h1 {
        font-size: 1.6rem;
    }
    
    .post-content h2 {
        font-size: 1.3rem;
    }
    
    .post-content h3 {
        font-size: 1.1rem;
    }
    
    .post-content pre {
        padding: 0.8rem;
        font-size: 0.85rem;
        overflow-x: auto;
    }
    
    .post-content blockquote {
        padding: 0.8rem 1rem;
    }
    
    .post-content table {
        font-size: 0.9rem;
    }
    
    .post-content img {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 480px) {
    .repo-container {
        padding: 20px 15px;
        border-radius: 15px;
    }
    
    .post-content {
        font-size: 0.9rem;
    }
    
    .post-content h1 {
        font-size: 1.4rem;
        margin: 1.5rem 0 1rem 0;
    }
    
    .post-content h2 {
        font-size: 1.2rem;
        margin: 1.3rem 0 0.8rem 0;
    }
    
    .post-content h3 {
        font-size: 1.05rem;
        margin: 1.1rem 0 0.7rem 0;
    }
    
    .post-content pre {
        padding: 0.6rem;
        font-size: 0.8rem;
        margin: 1rem 0;
    }
    
    .post-content ul,
    .post-content ol {
        margin-left: 1.2rem;
    }
    
    .post-content blockquote {
        padding: 0.6rem 0.8rem;
        margin: 1rem 0;
    }
    
    .post-content table {
        font-size: 0.8rem;
    }
    
    .post-content td,
    .post-content th {
        padding: 0.4rem;
    }
}
