/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Typography - Multi-language support */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, 
                 "Noto Sans", "Noto Sans CJK SC", "Noto Sans CJK TC", "Noto Sans CJK JP", 
                 "Noto Sans CJK KR", sans-serif;
    line-height: 1.6;
    color: #24292e;
    background: #ffffff;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-size: 16px;
}

/* Ensure proper CJK font rendering */
:lang(zh-cn), :lang(zh-Hans) {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", 
                 "Noto Sans CJK SC", sans-serif;
}

:lang(zh-tw), :lang(zh-Hant) {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", 
                 "Noto Sans CJK TC", sans-serif;
}

:lang(ja) {
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", 
                 "Yu Gothic", "Noto Sans CJK JP", sans-serif;
}

:lang(ko) {
    font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", 
                 "Noto Sans CJK KR", sans-serif;
}

/* Header Styles */
header {
    border-bottom: 2px solid #e1e4e8;
    margin-bottom: 2em;
    padding-bottom: 1em;
}

.header-content h1 {
    font-size: 2em;
    margin-bottom: 0.25em;
    font-weight: 600;
}

.header-content h1 a {
    color: #24292e;
    text-decoration: none;
}

.header-content h1 a:hover {
    text-decoration: underline;
}

.site-description {
    color: #586069;
    font-size: 0.95em;
    margin-bottom: 1em;
    line-height: 1.5;
}

/* Navigation */
.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    margin-top: 1em;
}

.main-nav ul li a {
    color: #0366d6;
    text-decoration: none;
    font-weight: 500;
}

.main-nav ul li a:hover {
    text-decoration: underline;
}

/* Main Content */
main {
    min-height: 60vh;
    margin-bottom: 3em;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    line-height: 1.3;
    font-weight: 600;
}

h1 { font-size: 2em; }
h2 { font-size: 1.5em; }
h3 { font-size: 1.25em; }
h4 { font-size: 1.1em; }

p {
    margin-bottom: 1em;
}

a {
    color: #0366d6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

a:hover {
    text-decoration: underline;
}

/* Lists */
ul, ol {
    margin-left: 2em;
    margin-bottom: 1em;
}

li {
    margin-bottom: 0.5em;
}

/* Code */
code {
    background: #f6f8fa;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

pre {
    background: #f6f8fa;
    padding: 1em;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1em;
}

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

/* Blockquotes */
blockquote {
    border-left: 4px solid #dfe2e5;
    padding-left: 1em;
    margin: 1em 0;
    color: #586069;
    font-style: italic;
}

/* Post Styles */
.post-header {
    margin-bottom: 2em;
    padding-bottom: 1em;
    border-bottom: 1px solid #e1e4e8;
}

.post-header h1 {
    margin-top: 0;
    margin-bottom: 0.5em;
}

.post-meta {
    color: #586069;
    font-size: 0.9em;
    display: flex;
    gap: 1em;
    align-items: center;
}

.lang-indicator {
    background: #f1f8ff;
    padding: 0.2em 0.6em;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 500;
    color: #0366d6;
    border: 1px solid #c8e1ff;
}

.post-description {
    color: #586069;
    font-style: italic;
    margin-top: 1em;
}

.post-content {
    margin: 2em 0;
}

.post-content img {
    max-width: 100%;
    height: auto;
    margin: 1em 0;
    border-radius: 6px;
}

.post-footer {
    margin-top: 3em;
    padding-top: 2em;
    border-top: 1px solid #e1e4e8;
    font-size: 0.9em;
}

.archive-notice,
.mirror-notice {
    background: #f6f8fa;
    padding: 1em;
    border-left: 4px solid #0366d6;
    margin: 1em 0;
    border-radius: 3px;
}

/* Post Navigation */
.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2em;
    padding-top: 2em;
    border-top: 1px solid #e1e4e8;
    gap: 1em;
}

.post-navigation a {
    color: #0366d6;
    text-decoration: none;
    font-weight: 500;
}

.post-navigation a:hover {
    text-decoration: underline;
}

.prev-post,
.next-post {
    flex: 1;
}

.next-post {
    text-align: right;
}

/* Post List */
.post-list {
    list-style: none;
    margin-left: 0;
}

.post-list li {
    margin-bottom: 2em;
    padding-bottom: 2em;
    border-bottom: 1px solid #e1e4e8;
}

.post-list li:last-child {
    border-bottom: none;
}

.post-list h2 {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    font-size: 1.5em;
}

.post-list h2 a {
    color: #24292e;
    text-decoration: none;
}

.post-list h2 a:hover {
    color: #0366d6;
    text-decoration: underline;
}

.post-date {
    color: #586069;
    font-size: 0.9em;
    display: block;
    margin-bottom: 0.5em;
}

/* Home Page */
.home h2 {
    margin-top: 2em;
    margin-bottom: 1em;
    padding-bottom: 0.5em;
    border-bottom: 1px solid #e1e4e8;
}

/* Footer */
footer {
    margin-top: 4em;
    padding-top: 2em;
    border-top: 2px solid #e1e4e8;
    font-size: 0.9em;
    color: #586069;
}

.footer-content {
    line-height: 1.6;
}

.footer-content p {
    margin-bottom: 1em;
}

.footer-content strong {
    color: #24292e;
    display: block;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.footer-content hr {
    margin: 2em 0;
}

/* Language Selector in Footer */
.language-selector {
    text-align: center;
    margin: 2em 0;
    padding: 1.5em;
    background: #f6f8fa;
    border-radius: 6px;
}

.language-selector a {
    display: inline-block;
    margin: 0.3em;
    padding: 0.4em 0.8em;
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    text-decoration: none;
    color: #0366d6;
    transition: all 0.2s;
}

.language-selector a:hover {
    background: #f1f8ff;
    border-color: #0366d6;
}

/* Resources Section */
.resources-section {
    margin: 2em 0;
    padding: 1.5em;
    background: #f6f8fa;
    border-radius: 6px;
}

.resources-section a {
    color: #0366d6;
}

/* Keywords Section */
.keywords-section {
    margin: 2em 0;
}

.keyword-group {
    margin: 1em 0;
    padding: 0.8em;
    background: #f6f8fa;
    border-radius: 4px;
    font-size: 0.85em;
}

.keyword-group strong {
    display: inline;
    margin: 0 0.5em 0 0;
}

/* Endorsements Section */
.endorsements-section {
    margin: 2em auto;
    max-width: 600px;
    background: #f1f8ff;
    border: 2px solid #c8e1ff;
    border-radius: 8px;
    padding: 1.5em;
    text-align: center;
}

.endorsements-section a {
    color: #0366d6;
}

/* Legal Section */
.legal-section {
    margin: 2em 0;
    color: #666;
    font-size: 0.85em;
}

.legal-section a {
    color: #0366d6;
}

.footer-links {
    margin: 1.5em 0;
}

.footer-links a {
    color: #0366d6;
}

.mirror-notice {
    background: #fff5b1;
    border-left: 4px solid #dbab09;
    padding: 1em;
    margin: 1.5em 0;
    border-radius: 3px;
}

.copyright,
.contact {
    font-size: 0.85em;
    margin-top: 1em;
}

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

th, td {
    border: 1px solid #e1e4e8;
    padding: 0.75em;
    text-align: left;
}

th {
    background: #f6f8fa;
    font-weight: 600;
}

/* Horizontal Rule */
hr {
    border: none;
    border-top: 1px solid #e1e4e8;
    margin: 2em 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 15px;
        font-size: 15px;
    }
    
    .header-content h1 {
        font-size: 1.5em;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0.5em;
    }
    
    .post-navigation {
        flex-direction: column;
        gap: 1em;
    }
    
    .next-post {
        text-align: left;
    }
    
    h1 { font-size: 1.75em; }
    h2 { font-size: 1.35em; }
    h3 { font-size: 1.15em; }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
        font-size: 14px;
    }
    
    .header-content h1 {
        font-size: 1.3em;
    }
    
    table {
        font-size: 0.85em;
    }
    
    th, td {
        padding: 0.5em;
    }
}

/* Print Styles */
@media print {
    body {
        max-width: 100%;
        font-size: 12pt;
    }
    
    header,
    footer,
    .post-navigation {
        page-break-inside: avoid;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .mirror-notice,
    .archive-notice {
        border: 1px solid #000;
    }
}

