/* Simplified Markdown HTML Styles */

body { 
    font-family: "system-ui, sans-serif";
    margin: 0; 
    padding: 10px; 
    line-height: 1.4;
    color: #222;
    font-size: 14px;
}

/* Container layout */
.container {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.main-content {
    width: 100%;
}

.sidebar {
    position: fixed;
    top: 100px;
    right: 20px;
    width: 200px;
    z-index: 1000;
}

/* Headings */
h1, h2 { 
    margin-top: 48px;
    margin-bottom: 24px;
}

h1 { 
    font-size: 20px;
}

h2 { 
    font-size: 17px;
}

h3 { 
    font-size: 15px;
    margin-top: 32px;
    margin-bottom: 12px;
}

h4 {
    font-size: 14px;
    font-weight: bold;
    margin-top: 24px;
    margin-bottom: 12px;
}

/* Paragraphs */
p {
    margin: 12px 0;
    line-height: 1.4;
}

/* Blockquotes */
blockquote { 
    border-left: 3px solid #ccc; 
    margin: 24px 0; 
    padding-left: 16px; 
    color: #666;
    line-height: 1.4;
}

/* Code */
code { 
    background: #f5f5f5; 
    padding: 2px 4px; 
    font-family: monospace;
    font-size: 13px;
}

pre { 
    background: #f5f5f5; 
    padding: 12px; 
    overflow-x: auto;
    margin: 24px 0;
    line-height: 1.4;
    font-size: 13px;
}

pre code {
    background: none;
    padding: 0;
}

/* Lists */
ul, ol { 
    margin: 20px 0;
    padding-left: 24px; 
    line-height: 1.4;
}

li { 
    margin: 4px 0; 
}

/* Links */
a { 
    color: #0066cc; 
}

a:visited {
    color: #888;
}

/* Back button keeps original color when visited */
a.back-button:visited {
    color: #0066cc;
}

a:hover { 
    text-decoration: underline; 
}

/* Tables */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 24px 0;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    font-size: 13px;
}

th {
    background: #f5f5f5;
}

/* Horizontal Rules */
hr {
    border: none;
    height: 1px;
    background: #ddd;
    margin: 36px auto;
}

/* Image Styles */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 16px auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Image Container */
figure {
    margin: 24px 0;
    text-align: center;
}

figure img {
    margin: 0 auto 8px;
}

/* Image Caption */
figcaption {
    font-size: 12px;
    color: #666;
    font-style: italic;
    margin-top: 8px;
    line-height: 1.4;
}

/* Hide captions containing URLs */
figcaption[aria-hidden="true"] {
    display: none;
}

/* Hide captions starting with http */
figcaption:is([title^="http"], [alt^="http"]) {
    display: none;
}

/* Mobile Image Optimization */
@media (max-width: 768px) {
    img {
        margin: 12px auto;
        border-radius: 2px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    }
    
    figure {
        margin: 16px 0;
    }
    
    figcaption {
        font-size: 11px;
        padding: 0 8px;
    }
}

/* Responsive layout */
@media (max-width: 1024px) {
    .sidebar {
        display: none;
    }
}

/* Update timestamp and footer styles */
.update-time {
    color: #666;
    font-size: 0.9em;
    margin-top: -8px;
    text-align: right;
}

.footer-quote {
    color: #666;
    font-size: 0.9em;
    text-align: center;
    margin-top: 24px;
}

/* Table of Contents Styles */
.toc {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
    font-size: 14px;
    text-align: right;
}

.toc h3 {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
    font-weight: normal;
    border: none;
    padding: 0;
    text-align: right;
}

.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc li {
    margin: 4px 0;
    padding: 0;
}

.toc a {
    color: #4a90e2;
    text-decoration: underline;
    padding: 0;
    border-radius: 0;
    transition: none;
    display: inline;
    font-size: 12px;
}

.toc a:hover {
    background: none;
    color: #357abd;
    text-decoration: underline;
}

.toc a:active {
    background: none;
}

.toc a:visited {
    color: #999;
}
