/* Common Global Styles */
body {
    font-family: 'Times New Roman', Times, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
}

.serif {
    font-family: 'Times New Roman', Times, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Post Entry Styles (Index Page) */
.post-entry {
    transition: all 0.2s ease;
}
.post-entry:hover .post-title {
    color: #2563eb;
}

/* Navigation Links */
.nav-link {
    position: relative;
    padding-bottom: 2px;
}
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: #2563eb;
    transition: width 0.3s ease;
}
.nav-link:hover::after {
    width: 100%;
}

/* Language Toggle Styles */
html[lang="en"] .lang-zh { display: none !important; }
html[lang="zh-CN"] .lang-en { display: none !important; }

.lang-btn {
    cursor: pointer;
    padding: 4px 12px;
    border-radius: 6px;
    background-color: #f3f4f6;
    color: #4b5563;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
}
.lang-btn:hover {
    background-color: #e5e7eb;
    color: #111827;
}

/* Dark mode specific for lang-btn handled by Tailwind classes in HTML */

/* Weather Toggle Icons Display */
.icon-none, .icon-rain, .icon-snow, .icon-constellation, .icon-fireflies, .icon-cherry, .icon-dandelion, .icon-ripples, .icon-grid { display: none; }
html.weather-none .icon-none { display: block; }
html.weather-rain .icon-rain { display: block; }
html.weather-snow .icon-snow { display: block; }
html.weather-constellation .icon-constellation { display: block; }
html.weather-fireflies .icon-fireflies { display: block; }
html.weather-cherry .icon-cherry { display: block; }
html.weather-dandelion .icon-dandelion { display: block; }
html.weather-ripples .icon-ripples { display: block; }
html.weather-grid .icon-grid { display: block; }

/* Article Typography (Post Page) */
.prose {
    font-family: 'Times New Roman', Times, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    max-width: 100%;
    font-size: 100% !important; /* 将字体大小调整为 0.95，比之前稍微大一点 */
}

/* 调整正文的行间距和段落间距，使其更紧凑 */
.prose p, 
.prose ul, 
.prose ol, 
.prose li {
    line-height: 1.55 !important;
}
.prose p {
    margin-top: 0.8em !important;
    margin-bottom: 0.8em !important;
}
.prose h2 {
    margin-top: 1.5em !important;
    margin-bottom: 0.8em !important;
}
.prose h3 {
    margin-top: 1.2em !important;
    margin-bottom: 0.6em !important;
}

/* Progress Bar (Post Page) */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 1000;
}
.progress-bar {
    height: 100%;
    background: #2563eb;
    width: 0%;
    transition: width 0.1s;
}

/* Back to top button (Post Page) */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 999;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    color: #2563eb;
    border-color: #2563eb;
    transform: translateY(-2px);
}
.dark .back-to-top {
    background: #1f2937;
    border-color: #374151;
    color: #9ca3af;
}

/* KaTeX Custom Display Style */
.katex-display {
    overflow-x: auto;
    overflow-y: hidden;
    margin: 1.5rem 0 !important;
}
.katex-display > .katex {
    text-align: center;
    white-space: normal;
}

/* Proof Box Style */
.proof-box {
    background-color: #f0fdf4; /* Tailwind green-50 */
    border: 1px solid #dcfce7; /* Tailwind green-100 */
    border-radius: 0.75rem; /* rounded-xl */
    padding: 1.5rem;
    margin: 2rem 0;
    transition: all 0.3s;
}
.dark .proof-box {
    background-color: #0f172a; /* Tailwind bg-slate-950 */
    border: 1px solid #67e8f9; /* Professional Cyan highlight full border */
    color: #e2e8f0; /* Crisp text color for the box */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3); /* Subtle shadow for depth */
}

/* Auto-numbering for headings to look like a paper */
.lang-zh, .lang-en { counter-reset: h2-counter; }
.lang-zh h2, .lang-en h2 { counter-reset: h3-counter; }
.lang-zh h2::before, .lang-en h2::before {
    counter-increment: h2-counter;
    content: counter(h2-counter) ". ";
}
.lang-zh h3::before, .lang-en h3::before {
    counter-increment: h3-counter;
    content: counter(h2-counter) "." counter(h3-counter) " ";
}