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

:root {
    --bg: #fefefe;
    --text: #1a1a1a;
    --text-dim: #666;
    --accent: #0066cc;
    --border: #ddd;
    --code-bg: #f8f8f8;
    --gradient-1: #0066cc;
    --gradient-2: #00a8ff;
}

[data-theme="dark"] {
    --bg: #0f0f0f;
    --text: #e0e0e0;
    --text-dim: #999;
    --accent: #4a9eff;
    --border: #333;
    --code-bg: #1a1a1a;
    --gradient-1: #4a9eff;
    --gradient-2: #00d4ff;
}

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

.math-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.03;
    background-image:
        radial-gradient(circle at 25% 25%, var(--text) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, var(--text) 1px, transparent 1px);
    background-size: 60px 60px;
    background-position: 0 0, 30px 30px;
    animation: mathBgFloat 20s ease-in-out infinite;
}

@keyframes mathBgFloat {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(10px, -5px) rotate(0.5deg);
    }

    66% {
        transform: translate(-5px, 10px) rotate(-0.3deg);
    }
}

header {
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    background: rgba(254, 254, 254, 0.9);
    backdrop-filter: blur(10px);
    z-index: 100;
    transition: all 0.3s ease;
}

[data-theme="dark"] header {
    background: rgba(15, 15, 15, 0.9);
}

header.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(0);
}

nav {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 600;
    font-size: 1.1rem;
    position: relative;
    transition: all 0.3s ease;
}

.logo:hover {
    transform: translateY(-2px);
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gradient-1), var(--gradient-2));
    transition: width 0.3s ease;
}

.logo:hover::after {
    width: 100%;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dim);
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gradient-1), var(--gradient-2));
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-links a:hover::before,
.nav-links a.active::before {
    width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
    transform: translateY(-2px);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.theme-toggle:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
}

.theme-toggle:hover::before {
    left: 100%;
}

main {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
    flex-grow: 1;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.intro {
    margin-bottom: 3rem;
    position: relative;
}

.intro h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
    background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite alternate;
    position: relative;
    padding-bottom: 0.1rem;
}

@keyframes gradientShift {
    0% {
        filter: hue-rotate(0deg);
    }

    100% {
        filter: hue-rotate(10deg);
    }
}

.intro p {
    font-size: 1.2rem;
    color: var(--text-dim);
    margin-bottom: 1rem;
    opacity: 1;
}

.intro p.initial-load {
    opacity: 0;
    animation: fadeInLeft 0.8s ease-out forwards;
}

.intro p.initial-load:nth-child(2) {
    animation-delay: 0.3s;
}

.intro p.initial-load:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.current-work {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.6s forwards;
}

.current-work::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--gradient-1), var(--gradient-2));
    transition: left 0.8s ease;
}

.current-work:hover::before {
    left: 100%;
}

.current-work:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.current-work h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.current-work p {
    color: var(--text-dim);
    margin-bottom: 0.8rem;
}

.work-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeInRight 0.6s ease-out forwards;
}

.work-item:nth-child(2) {
    animation-delay: 0.1s;
}

.work-item:nth-child(3) {
    animation-delay: 0.2s;
}

.work-item:nth-child(4) {
    animation-delay: 0.3s;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.work-item:last-child {
    border-bottom: none;
}

.work-item:hover {
    background: rgba(0, 102, 204, 0.05);
    padding: 0.8rem 1rem;
    margin: 0 -1rem;
    border-radius: 8px;
}

.work-title {
    font-weight: 500;
    transition: color 0.3s ease;
}

.work-item:hover .work-title {
    color: var(--accent);
}

.work-status {
    font-size: 0.9rem;
    color: var(--accent);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    background: rgba(0, 102, 204, 0.1);
    transition: all 0.3s ease;
}

.work-item:hover .work-status {
    background: var(--accent);
    color: white;
    transform: scale(1.05);
}

.about-section {
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.about-section:nth-child(2) {
    animation-delay: 0.2s;
}

.about-section:nth-child(3) {
    animation-delay: 0.4s;
}

.about-section h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.about-section h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--gradient-1), var(--gradient-2));
    border-radius: 2px;
}

.about-section p {
    margin-bottom: 1rem;
    color: var(--text-dim);
    transition: color 0.3s ease;
}

.about-section:hover p {
    color: var(--text);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.skill-category {
    padding: 1.5rem;
    background: var(--code-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.skill-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--gradient-1), var(--gradient-2));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.skill-category:hover::before {
    transform: scaleX(1);
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.skill-category h4 {
    font-weight: 600;
    margin-bottom: 0.8rem;
    font-size: 1rem;
    color: var(--accent);
}

.skill-list {
    list-style: none;
}

.skill-list li {
    color: var(--text-dim);
    padding: 0.2rem 0;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    padding-left: 15px;
}

.skill-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.skill-category:hover .skill-list li::before {
    opacity: 1;
}

.skill-list li:hover {
    color: var(--text);
    transform: translateX(5px);
}

.projects {
    margin: 3rem 0;
}

.project-item {
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    background: var(--code-bg);
    position: relative;
    overflow: hidden;
}

.project-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 102, 204, 0.05), transparent);
    transition: left 0.8s ease;
}

.project-item:hover::before {
    left: 100%;
}

.project-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--accent);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.project-title {
    font-weight: 500;
    margin-bottom: 0.3rem;
    color: var(--accent);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.project-title:hover {
    color: var(--text);
    transform: scale(1.02);
}

.project-tech {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tech::before {
    content: '';
    width: 20px;
    height: 1px;
    background: var(--accent);
    margin: 0.5rem 0.5rem 0.5rem 0;
}

.project-description {
    font-size: 0.95rem;
    color: var(--text-dim);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.project-links {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

.project-link {
    color: var(--accent);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: transparent;
}

.project-link:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
}

.project-stars {
    font-size: 0.9rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.8rem;
    background: rgba(0, 102, 204, 0.1);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.project-item:hover .project-stars {
    background: var(--accent);
    color: white;
    transform: scale(1.05);
}





footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 4rem;
    position: relative;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.social-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    width: 48px;
    height: 48px;
}

.social-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--gradient-1), var(--gradient-2));
    transition: left 0.3s ease;
    z-index: -1;
}

.social-item:hover::before {
    left: 0;
}

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

.social-item:hover .social-icon {
    color: white;
    transform: scale(1.1);
}

.social-icon {
    width: 24px;
    height: 24px;
    color: var(--text-dim);
    transition: all 0.3s ease;
}

.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 600px) {
    .nav-links {
        gap: 1rem;
    }

    .intro h1 {
        font-size: 2rem;
    }

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

    .project-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .project-links {
        flex-wrap: wrap;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .social-item {
        width: 44px;
        height: 44px;
    }

    .social-icon {
        width: 20px;
        height: 20px;
    }
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.reduced-motion * {
    animation-duration: 0.01s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01s !important;
}

.blog-header {
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.blog-intro {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding: 2rem 0;
}

.blog-intro-main {
    font-size: 1.3rem;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 1rem;
    font-weight: 500;
}

.blog-intro-sub {
    font-size: 1.1rem;
    line-height: 1.5;
    color: var(--text-dim);
    font-style: italic;
    margin: 0;
}

.blog-list {
    display: grid;
    gap: 2rem;
}

.blog-item {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.blog-item:nth-child(2) {
    animation-delay: 0.1s;
}

.blog-item:nth-child(3) {
    animation-delay: 0.2s;
}

.blog-item:nth-child(4) {
    animation-delay: 0.3s;
}

.blog-item:nth-child(5) {
    animation-delay: 0.4s;
}

.blog-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--gradient-1), var(--gradient-2));
    transition: left 0.8s ease;
}

.blog-item:hover::before {
    left: 100%;
}

.blog-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: var(--accent);
}

.blog-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.blog-item-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.blog-item-date {
    font-size: 0.9rem;
    color: var(--text-dim);
    background: rgba(0, 102, 204, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    white-space: nowrap;
}

.blog-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.blog-tag {
    font-size: 0.8rem;
    color: var(--accent);
    background: rgba(0, 102, 204, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    border: 1px solid rgba(0, 102, 204, 0.2);
}

.blog-item-excerpt {
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.blog-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.read-time {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.read-time::before {
    content: '📖';
}

.blog-post {
    animation: fadeInUp 0.6s ease-out;
}

.back-to-blog {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    display: none;
    align-items: center;
    gap: 0.5rem;
    position: fixed;
    top: 80px;
    left: 2rem;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.back-to-blog:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateX(-3px);
}

.back-arrow {
    display: none;
}

@media (max-width: 480px) {
    .back-to-blog {
        display: none !important;
    }
}

.post-content {
    max-width: none;
}

.post-content h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text);
    line-height: 1.3;
}

.post-content h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    color: var(--text);
    position: relative;
    padding-bottom: 0.5rem;
}

.post-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, var(--gradient-1), var(--gradient-2));
}

.post-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 1.5rem 0 0.8rem 0;
    color: var(--text);
}

.post-content p {
    margin-bottom: 1.2rem;
    line-height: 1.7;
    color: var(--text-dim);
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.2rem;
    padding-left: 2rem;
    color: var(--text-dim);
}

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

.post-content blockquote {
    border-left: 4px solid var(--accent);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--code-bg);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-dim);
}

.post-content code {
    background: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--accent);
    border: 1px solid var(--border);
}

.post-content pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    position: relative;
}

.post-content pre code {
    background: none;
    padding: 0;
    border: none;
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.5;
}

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

.post-content a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.post-content a:hover {
    border-bottom-color: var(--accent);
}

.hljs {
    background: var(--code-bg) !important;
    color: var(--text) !important;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in {
    color: #d73a49;
}

.hljs-string,
.hljs-attr {
    color: #032f62;
}

.hljs-comment {
    color: #6a737d;
    font-style: italic;
}

.hljs-number {
    color: #005cc5;
}

.hljs-function,
.hljs-title {
    color: #6f42c1;
}

[data-theme="dark"] .hljs-keyword,
[data-theme="dark"] .hljs-selector-tag,
[data-theme="dark"] .hljs-built_in {
    color: #ff7b72;
}

[data-theme="dark"] .hljs-string,
[data-theme="dark"] .hljs-attr {
    color: #a5d6ff;
}

[data-theme="dark"] .hljs-comment {
    color: #8b949e;
}

[data-theme="dark"] .hljs-number {
    color: #79c0ff;
}

[data-theme="dark"] .hljs-function,
[data-theme="dark"] .hljs-title {
    color: #d2a8ff;
}

.blog-loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-dim);
}

.blog-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top: 2px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

.blog-empty-state {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    padding: 3rem 2rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.empty-state-content {
    text-align: center;
    max-width: 400px;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-state-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

.empty-state-content p {
    color: var(--text-dim);
    line-height: 1.6;
    font-size: 1rem;
}

.projects-loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-dim);
}

.projects-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top: 2px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

.blog-header.hidden {
    display: none;
}

.loading-stars {
    opacity: 0.6;
    animation: pulse 1.5s ease-in-out infinite;
}

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

@media (max-width: 600px) {
    .blog-intro {
        padding-left: 1.5rem;
        padding: 1.5rem 0;
        padding-left: 1.5rem;
    }
    
    .blog-intro-main {
        font-size: 1.1rem;
    }
    
    .blog-intro-sub {
        font-size: 1rem;
    }

    .blog-item {
        padding: 1.5rem;
    }

    .blog-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .post-content h1 {
        font-size: 1.8rem;
    }

    .post-content h2 {
        font-size: 1.5rem;
    }

    .post-content pre {
        padding: 1rem;
        font-size: 0.8rem;
    }
}

.copy-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.copy-button:hover {
    opacity: 1;
    transform: scale(1.05);
}

.copy-button.copied {
    background: #28a745;
}

.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.post-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text);
    line-height: 1.3;
}

.post-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.post-date {
    background: rgba(0, 102, 204, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
}

.post-read-time {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.post-read-time::before {
    content: '📖';
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 768px) and (min-width: 481px) {
    .back-to-blog {
        position: static !important;
        margin-bottom: 2rem !important;
        width: fit-content !important;
        padding: 0.5rem 1rem !important;
        border-radius: 6px !important;
        height: auto !important;
    }

    .back-text {
        display: inline !important;
    }

    .back-arrow {
        display: none !important;
    }
}

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--code-bg);
    border-radius: 6px;
    border: 1px solid var(--border);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gradient-1), var(--gradient-2));
    border-radius: 6px;
    border: 2px solid var(--code-bg);
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--gradient-2), var(--gradient-1));
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0, 102, 204, 0.3);
}

::-webkit-scrollbar-thumb:active {
    background: var(--accent);
}

::-webkit-scrollbar:horizontal {
    height: 12px;
}

::-webkit-scrollbar-track:horizontal {
    background: var(--code-bg);
    border-radius: 6px;
    border: 1px solid var(--border);
}

::-webkit-scrollbar-thumb:horizontal {
    background: linear-gradient(90deg, var(--gradient-1), var(--gradient-2));
    border-radius: 6px;
    border: 2px solid var(--code-bg);
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:horizontal:hover {
    background: linear-gradient(90deg, var(--gradient-2), var(--gradient-1));
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0, 102, 204, 0.3);
}

::-webkit-scrollbar-corner {
    background: var(--code-bg);
}

html {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--code-bg);
}

[data-theme="dark"] html {
    scrollbar-color: var(--accent) var(--code-bg);
}

pre::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

pre::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

pre::-webkit-scrollbar-thumb:hover {
    opacity: 1;
    background: var(--gradient-2);
}

