:root { 
    --max-width: 760px; 
    --text-color: #333; 
    --bg-color: #f9f9f9; 
    --card-bg: #fff;
    --point-color: #03C75A; 
    --gray-text: #888; 
}

* { box-sizing: border-box; }

body { 
    font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 
    line-height: 1.6; 
    color: var(--text-color); 
    margin: 0; 
    padding: 20px; 
    background: var(--bg-color); 
    word-break: keep-all; 
}

header, main, footer { max-width: var(--max-width); margin: 0 auto; }

/* === Header (Index) === */
body > header { 
    margin-bottom: 40px; 
    padding: 20px 0 30px; 
    text-align: center; 
}
h1 { margin: 0; font-size: 1.8rem; color: #222; font-weight: 800; letter-spacing: -0.03em; }
h1 a { text-decoration: none; color: inherit; }
.subtitle { font-size: 0.95rem; color: #666; margin-top: 10px; font-weight: 400; }

/* === Navigation (View) === */
.nav-header { margin-bottom: 20px; }
.back-link { 
    display: inline-flex; 
    align-items: center;
    text-decoration: none; 
    color: var(--gray-text); 
    font-size: 0.95rem; 
    font-weight: 500; 
    transition: color 0.2s; 
    background: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.back-link:hover { color: #333; box-shadow: 0 4px 8px rgba(0,0,0,0.08); }

/* === Index Page: Post List === */
.post-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 30px; }

.post-item { 
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    border: 1px solid #f0f0f0;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative; 
}

.post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
}

.card-image-top {
    display: block;
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-bottom: 1px solid #f5f5f5;
    transition: opacity 0.2s;
    position: relative; 
    z-index: 0;
}
.card-image-top:hover { opacity: 0.95; }

.post-content-wrapper { padding: 30px; }

.post-title { font-size: 1.5rem; margin: 0 0 15px; line-height: 1.35; letter-spacing: -0.02em; }

.post-title a { 
    text-decoration: none; 
    color: #111; 
    font-weight: 700; 
    display: block; 
}
.post-title a::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}
.post-title a:hover { color: var(--point-color); }

.post-snippet { 
    font-size: 1.05rem; 
    color: #555; 
    margin-bottom: 25px; 
    line-height: 1.7; 
    display: -webkit-box; 
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #f5f5f5;
    margin-top: 20px;
    position: relative; 
    z-index: 3; 
    pointer-events: none;
}

.post-date { font-size: 0.85rem; color: #aaa; font-family: monospace; }

/* === View Page: Article === */
.view-article {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 4px 25px rgba(0,0,0,0.04);
    padding: 40px;
    overflow: hidden;
}

.view-article header { 
    margin-bottom: 40px; 
    border-bottom: 1px solid #f5f5f5; 
    padding-bottom: 30px; 
}

.view-article h1 { 
    font-size: 2rem; 
    margin: 0 0 20px; 
    line-height: 1.3; 
    letter-spacing: -0.02em; 
    font-weight: 800; 
    color: #111; 
}

.meta-info { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    font-size: 0.9rem; 
    color: #999; 
}

.content { font-size: 1.15rem; color: #333; line-height: 1.8; }
.content h2 { font-size: 1.6rem; margin-top: 50px; margin-bottom: 25px; color: #111; font-weight: 700; letter-spacing: -0.02em; }
.content h3 { font-size: 1.35rem; margin-top: 40px; margin-bottom: 20px; color: #444; font-weight: 600; }
.content p { margin-bottom: 1.8em; }
.content ul, .content ol { margin-bottom: 1.8em; padding-left: 20px; color: #444; }

figure { margin: 40px -40px; width: calc(100% + 80px); }
.content img, figure img { 
    width: 100%; 
    height: auto; 
    display: block; 
    cursor: pointer; 
    transition: opacity 0.2s; 
}
.content img:hover, figure img:hover { opacity: 0.95; }

/* === Common Elements === */
.origin-link { 
    display: inline-flex; 
    align-items: center;
    font-weight: 600; 
    color: var(--point-color); 
    text-decoration: none; 
    font-size: 0.9rem; 
    background: #f0fff4; 
    padding: 4px 10px; 
    border-radius: 6px;
    position: relative; 
    z-index: 3;
    pointer-events: auto;
}
.origin-link:hover { background: #e6fffa; }

/* CTA Box (View Page) */
.cta-box { 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none; 
    background: #f8f9fa; 
    border-radius: 16px; 
    padding: 30px; 
    margin-top: 60px; 
    border: 1px solid #eee;
    transition: all 0.2s ease;
    cursor: pointer;
}
.cta-box:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    border-color: #ddd;
}
.cta-title { 
    font-size: 1.1rem; 
    font-weight: 700; 
    color: #444; 
    margin: 0 0 15px 0; 
}

.cta-button-style { 
    display: inline-block; 
    background-color: var(--point-color); 
    color: white; 
    padding: 12px 30px; 
    border-radius: 50px; 
    font-weight: 700; 
    font-size: 1rem; 
    box-shadow: 0 2px 6px rgba(3, 199, 90, 0.2); 
    transition: background-color 0.2s, box-shadow 0.2s;
}
.cta-box:hover .cta-button-style {
    background-color: #02b150;
    box-shadow: 0 4px 12px rgba(3, 199, 90, 0.3); 
}

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 60px; }
.page-link { 
    padding: 10px 15px; 
    background: #fff; 
    border: 1px solid #eee; 
    border-radius: 8px; 
    text-decoration: none; 
    color: #555; 
    font-size: 0.95rem; 
    font-weight: 500;
    transition: all 0.2s; 
}
.page-link:hover { background-color: #f8f8f8; border-color: #ddd; color: #222; }
.page-link.active { 
    background-color: var(--point-color); 
    color: white; 
    border-color: var(--point-color); 
    font-weight: 700;
}
.page-link.disabled { opacity: 0.5; pointer-events: none; }

/* Footer */
footer { margin-top: 80px; font-size: 0.85rem; color: #aaa; text-align: center; padding-bottom: 40px; }

/* Mobile */
@media (max-width: 600px) {
    .view-article { padding: 25px 20px; }
    figure { margin: 30px -20px; width: calc(100% + 40px); }
    h1 { font-size: 1.6rem; }
}