* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; line-height: 1.7; color: #222; background: #fff; }
.container { max-width: 780px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { border-bottom: 1px solid #e5e5e5; padding: 20px 0; margin-bottom: 40px; }
.site-header .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.site-title { font-size: 1.3rem; font-weight: 700; color: #000; text-decoration: none; }
.site-nav { display: flex; gap: 20px; }
.site-nav a { color: #555; text-decoration: none; font-size: 0.95rem; }
.site-nav a:hover { color: #000; }

/* Hero */
.hero { padding: 40px 0; text-align: center; }
.hero h1 { font-size: 2rem; margin-bottom: 15px; }
.hero p { font-size: 1.1rem; color: #555; max-width: 600px; margin: 0 auto; }

/* Post Grid */
.featured, .all-posts { padding: 30px 0; }
.featured h2, .all-posts h2 { font-size: 1.3rem; margin-bottom: 20px; padding-bottom: 8px; border-bottom: 2px solid #000; display: inline-block; }
.post-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
.post-card { padding: 20px; border: 1px solid #e5e5e5; border-radius: 6px; transition: border-color 0.2s; }
.post-card:hover { border-color: #999; }
.post-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.post-card h3 a { color: #000; text-decoration: none; }
.post-card h3 a:hover { text-decoration: underline; }
.post-card p { color: #555; font-size: 0.95rem; }
.post-meta { display: flex; gap: 15px; font-size: 0.82rem; color: #888; margin-bottom: 6px; }

/* Post */
.post-header { margin-bottom: 30px; }
.post-title { font-size: 1.8rem; line-height: 1.3; margin-bottom: 10px; }
.post-content { font-size: 1.05rem; line-height: 1.8; }
.post-content h2 { font-size: 1.4rem; margin: 40px 0 15px; padding-bottom: 6px; border-bottom: 1px solid #eee; }
.post-content h3 { font-size: 1.15rem; margin: 30px 0 10px; }
.post-content h4 { font-size: 1.05rem; margin: 20px 0 8px; font-weight: 700; }
.post-content p { margin-bottom: 18px; }
.post-content ul, .post-content ol { margin: 0 0 20px 24px; }
.post-content li { margin-bottom: 6px; }
.post-content table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 0.92rem; }
.post-content th, .post-content td { border: 1px solid #ddd; padding: 10px 12px; text-align: left; }
.post-content th { background: #f7f7f7; font-weight: 600; }
.post-content tr:nth-child(even) { background: #fafafa; }
.post-content blockquote { border-left: 3px solid #ccc; margin: 20px 0; padding: 10px 20px; color: #555; background: #f9f9f9; }
.post-content strong { font-weight: 600; }
.post-content code { background: #f5f5f5; padding: 2px 6px; border-radius: 3px; font-size: 0.9em; }
.post-content a { color: #0066cc; }
.post-content hr { border: 0; border-top: 1px solid #eee; margin: 30px 0; }

/* Comments */
.comments { margin-top: 50px; padding-top: 30px; border-top: 2px solid #000; }
.comments h3 { font-size: 1.1rem; margin-bottom: 10px; }
.comments > p { color: #666; font-size: 0.95rem; margin-bottom: 25px; }

/* Related */
.related-posts { margin-top: 50px; padding-top: 30px; border-top: 2px solid #000; }
.related-posts h3 { font-size: 1.1rem; margin-bottom: 15px; }
.related-posts ul { list-style: none; }
.related-posts li { margin-bottom: 8px; }
.related-posts a { color: #0066cc; }

/* List page */
.post-list .post-card { margin-bottom: 24px; }
.post-list h1 { font-size: 1.6rem; margin-bottom: 30px; }

/* Footer */
.site-footer { margin-top: 60px; padding: 30px 0; border-top: 1px solid #e5e5e5; text-align: center; }
.site-footer p { color: #888; font-size: 0.85rem; }

/* Feedback sidebar */
#feedback-sidebar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    display: flex;
}
#feedback-tab {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    padding: 14px 10px;
    background: #000;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 2px;
    border-radius: 6px 0 0 6px;
    transition: background 0.2s;
}
#feedback-tab:hover { background: #333; }
#feedback-panel {
    display: none;
    width: 380px;
    max-height: 78vh;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-right: none;
    border-radius: 8px 0 0 8px;
    padding: 24px;
    box-shadow: -2px 0 20px rgba(0,0,0,0.12);
}
#feedback-panel.open { display: block; }
.feedback-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.feedback-panel-header h3 {
    font-size: 1.1rem;
    margin: 0;
}
#feedback-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: #888;
    line-height: 1;
    padding: 0 4px;
}
#feedback-close:hover { color: #000; }
.feedback-intro {
    color: #666;
    font-size: 0.92rem;
    margin-bottom: 20px;
}

/* Back to top */
#back-to-top {
    position: fixed;
    bottom: 28px;
    right: 24px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #000;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, background 0.2s;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
#back-to-top.visible { opacity: 1; visibility: visible; }
#back-to-top:hover { background: #333; }

/* Mobile */
@media (max-width: 600px) {
    .hero h1 { font-size: 1.5rem; }
    .post-title { font-size: 1.4rem; }
    .post-content { font-size: 1rem; }
    .post-content table { font-size: 0.8rem; }
    #feedback-panel { width: 100vw; border-radius: 8px 8px 0 0; }
    #back-to-top { bottom: 16px; right: 12px; width: 36px; height: 36px; font-size: 1.1rem; }
}
