:root {
    --font-size: 15px;
    --font-family: "PingFang TC", "Noto Serif TC", "Microsoft JhengHei", "Heiti TC", serif;
    --color-text: #333;
    --color-link: #1a6eb6;
    --color-light: #666;
    --color-border: #e9ecef;
    --color-bg: #fff;
    --color-bg-light: #f8f9fa;
    --max-width: 800px;
}

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

body {
    font-family: "Helvetica Neue", Arial, "PingFang TC", "Microsoft JhengHei", sans-serif;
    font-size: var(--font-size);
    color: var(--color-text);
    background: var(--color-bg-light);
    line-height: 1.8;
}

h1, h2, h3, .site-title { font-family: var(--font-family); }

a { color: var(--color-link); }
img { max-width: 100%; height: auto; border-radius: 15px; }

.site-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    background: var(--color-bg-light);
}

.site-header {
    padding: 16px 20px 14px;
    text-align: center;
    background: var(--color-bg-light);
    border-bottom: 1px solid #ccc;
}
.site-header a { color: var(--color-text); text-decoration: none; }
.site-title { font-size: 26px; font-weight: 700; letter-spacing: 0.08em; margin-bottom: 6px; }
.site-title a:hover { color: var(--color-link); }
.site-description { font-size: 13px; color: var(--color-light); letter-spacing: 0.04em; }

.site-main { padding: 40px 0; }

article.post { padding: 0; }

.post-header { margin-bottom: 20px; text-align: center; }
.post-header h1 { font-size: 24px; line-height: 1.4; margin-bottom: 10px; }
.post-meta {
    font-size: 13px;
    color: var(--color-light);
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}
.category, .tag {
    text-decoration: none;
    color: var(--color-text);
    transition: background 0.2s, color 0.2s;
}
.category:hover {
    background: #2980b9;
    color: #fff;
}
.tag:hover {
    background: #e6c84a;
    color: #5a4500;
    cursor: default;
}
.category {
    display: inline-block;
    background: #e0e0e0;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 13px;
    margin: 0 4px 4px 0;
}

.post-content h2 { font-size: 20px; margin: 30px 0 12px; }
.post-content h3 { font-size: 17px; margin: 25px 0 10px; }
.post-content p { margin-bottom: 14px; text-align: justify; letter-spacing: 0.04em; }
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    margin: 12px 0;
}
.post-content a { color: var(--color-link); text-decoration: none; }
.post-content a:hover { text-decoration: underline; }
.post-content blockquote {
    border-left: 3px solid var(--color-border);
    padding-left: 16px;
    color: var(--color-light);
    margin: 14px 0;
}
.post-content ul, .post-content ol { padding-left: 24px; margin-bottom: 14px; }
.post-content li { margin-bottom: 4px; }
.post-content table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.post-content td, .post-content th {
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    font-size: 13px;
}

.post-tags { margin-top: 20px; }
.post-tags > .icon,
.post-categories > .icon { width: 14px; height: 14px; color: var(--color-light); margin-right: 4px; vertical-align: middle; fill: currentColor; }
.tag {
    display: inline-block;
    background: #e0e0e0;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 13px;
    margin: 0 4px 4px 0;
}

.faq-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--color-border);
}
.faq-main-title { font-size: 1.5em; margin-bottom: 20px; font-weight: 700; }
.faq-container * { box-sizing: border-box; }
.faq-details {
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fdfdfd;
    padding: 12px 14px;
    margin: 0.6em 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
    display: block;
}
.faq-details:first-child { margin-top: 0; }
.faq-details:last-child { margin-bottom: 0; }
.faq-details[open] {
    background: #fafafa;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin: 0.4em 0;
}
.faq-summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
    outline: none;
    transition: color 0.3s ease;
    margin: 0;
    padding: 0;
    color: #333;
    line-height: 1.4;
}
.faq-summary::-webkit-details-marker { display: none; }
.faq-summary::marker { content: ""; }
.faq-summary:hover { color: #0073aa; }
.faq-summary::after {
    content: "";
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-left: 12px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat center;
    transition: transform 0.3s ease;
}
.faq-details[open] .faq-summary::after { transform: rotate(180deg); }
.faq-answer {
    margin-top: 10px;
    color: #555;
    line-height: 1.6;
    animation: faqFadeIn 0.3s ease;
}
.faq-answer p { margin: 0 0 8px 0; font-size: 1rem; }
@keyframes faqFadeIn { 0% { opacity: 0; transform: translateY(-2px); } 100% { opacity: 1; transform: translateY(0); } }
.archive-title { font-size: 22px; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 2px solid var(--color-border); }

.posts-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.post-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.post-card.pinned { border-left: 3px solid var(--color-link); }
.post-thumbnail { overflow: hidden; }
.post-thumbnail img { width: 100%; height: 240px; object-fit: cover; border-radius: 0; transition: transform 0.3s ease; }
.post-thumbnail:hover img { transform: scale(1.05); }
.post-card-body { padding: 12px; display: flex; flex-direction: column; flex: 1; }
.post-card-body h2 {
    font-size: 16px;
    margin-bottom: 16px;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.post-card-body h2 a { color: var(--color-text); text-decoration: none; }
.post-card-body h2 a:hover { color: var(--color-link); }
.post-excerpt { font-size: 14px; line-height: 1.7; margin: 0 0 8px; color: var(--color-text); text-align: justify; }
.post-card-body time { font-size: 12px; color: var(--color-light); }
.homepage .post-card-body time { display: none; }

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 36px;
    font-size: 14px;
}
.pagination a {
    color: var(--color-link);
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
}
.pagination a:hover { background: var(--color-bg-light); }
.pagination a.page-num { padding: 6px 12px; }
.pagination a.active { background: var(--color-link); color: #fff; border-color: var(--color-link); pointer-events: none; }

.site-footer {
    background: var(--color-bg-light);
    border-top: 1px solid #ccc;
    padding: 24px 20px;
    text-align: center;
    font-size: 12px;
    color: #595959;
    letter-spacing: 0.03em;
}
.site-footer a { color: #595959; text-decoration: none; }
.site-footer a:hover { color: var(--color-link); }

.error-page { text-align: center; padding: 60px 0; }
.error-code { font-size: 72px; color: var(--color-border); margin-bottom: 10px; }
.error-message { font-size: 20px; margin-bottom: 10px; }
.error-hint { color: var(--color-light); margin-bottom: 20px; }

@media (max-width: 768px) {
    .posts-list { grid-template-columns: 1fr; }
    .post-thumbnail img { height: 200px; }
    .site-header { padding: 12px 16px 10px; }
    .site-title { font-size: 22px; }
    .site-main { padding: 20px 16px; }
    .faq-details { padding: 10px 12px; margin: 0.25em 0; }
    .faq-summary { font-size: 1rem; }
}

@media (max-width: 600px) {
    .site-title { font-size: 20px; }
    .post-header h1 { font-size: 20px; }
}
