/* ── 文章前台樣式 ── */

/* 兩欄佈局 */
.post-layout {
    display: flex;
    gap: 48px;
    align-items: flex-start;
    padding: 20px 0 40px;
}
.post-main {
    flex: 7;
    min-width: 0;
}
.post-sidebar {
    flex: 3;
    min-width: 0;
    max-width: 280px;
    position: sticky;
    top: 20px;
}

/* 文章列表 */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.post-item {
    display: flex;
    gap: 18px;
    padding: 18px 20px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e4ecf6;
    transition: border-color 0.2s, transform 0.15s;
    align-items: flex-start;
}
.post-item:hover {
    border-color: #b8cce0;
    transform: translateY(-2px);
}
.post-item .post-thumb {
    flex: 0 0 150px;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
}
.post-item .post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: scale-down;
    display: block;
}
.post-item .post-content {
    flex: 1;
}
.post-item .post-content .post-meta {
    font-size: 0.7rem;
    color: #7a8fa4;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.pinned-badge {
    font-size: 0.65rem;
    background: #fff3cd;
    color: #856404;
    padding: 1px 8px;
    border-radius: 4px;
}
.post-item .post-content h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #0b1929;
    margin: 2px 0 4px;
    line-height: 1.4;
}
.post-item .post-content h3 a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}
.post-item .post-content h3 a:hover {
    color: #2563eb;
}
.post-item .post-content .excerpt {
    font-size: 0.85rem;
    color: #5a6f88;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 分頁 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(37, 99, 235, 0.06);
}
.pagination a {
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #5a6f88;
    transition: 0.2s;
}
.pagination a:hover {
    background: #e8edf6;
    color: #2563eb;
}
.pagination a.active {
    background: #2563eb;
    color: #fff;
}

/* 側邊欄 */
.sidebar-widget {
    background: #fff;
    border-radius: 18px;
    border: 1px solid #e4ecf6;
    padding: 22px 20px;
    margin-bottom: 20px;
}
.sidebar-widget .widget-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0b1929;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-widget .widget-title i {
    color: #2563eb;
    font-size: 0.9rem;
}

/* 熱門文章 */
.hot-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.hot-item {
    display: flex;
    gap: 12px;
    align-items: center;
}
.hot-item .rank {
    font-size: 0.7rem;
    font-weight: 700;
    color: #7a8fa4;
    background: #eef3fa;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.hot-item .rank.top {
    background: #2563eb;
    color: #fff;
}
.hot-item .hot-info {
    flex: 1;
    min-width: 0;
}
.hot-item .hot-info h4 {
    font-size: 0.88rem;
    font-weight: 600;
    color: #0b1929;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hot-item .hot-info h4 a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}
.hot-item .hot-info h4 a:hover {
    color: #2563eb;
}
.hot-item .hot-info .views {
    font-size: 0.7rem;
    color: #7a8fa4;
}

/* ═══════════════════════════════════════
   文章詳細頁
   ═══════════════════════════════════════ */

.post-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eef3f8;
}
.post-header .breadcrumb {
    font-size: 0.8rem;
    color: #8aa0b8;
    margin-bottom: 8px;
}
.post-header .breadcrumb a {
    color: #8aa0b8;
    text-decoration: none;
    transition: color 0.2s;
}
.post-header .breadcrumb a:hover {
    color: #2563eb;
}
.post-header .breadcrumb .sep {
    margin: 0 6px;
    color: #c0d0e0;
}
.post-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0b1929;
    line-height: 1.3;
    margin: 0 0 10px;
    letter-spacing: -0.5px;
}
.post-header .post-meta {
    display: flex;
    gap: 16px;
    font-size: 0.82rem;
    color: #7a8fa4;
    flex-wrap: wrap;
}
.post-header .post-meta i {
    margin-right: 4px;
}

/* 文章白卡片 */
.article-card {
    background: #fff;
    border-radius: 18px;
    border: 1px solid #e4ecf6;
    padding: 30px 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.01);
}

/* 文章內文 */
.post-body {
    font-size: 1rem;
    line-height: 1.8;
    color: #1a2b3e;
}
.post-body p {
    margin: 0 0 1em;
}
.post-body h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0b1929;
    margin: 1.4em 0 0.5em;
}
.post-body h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0b1929;
    margin: 1.2em 0 0.4em;
}
.post-body ul {
    margin: 0 0 1em;
    padding-left: 1.5em;
}
.post-body ul li {
    margin-bottom: 4px;
}
.post-body blockquote {
    margin: 1em 0;
    padding: 14px 20px;
    background: #f0f5fe;
    border-left: 4px solid #2563eb;
    border-radius: 0 10px 10px 0;
    color: #25435f;
    font-style: italic;
}
.post-body pre {
    background: #0b1929;
    color: #e8edf6;
    border-radius: 12px;
    padding: 16px 20px;
    overflow-x: auto;
    font-size: 0.88rem;
    line-height: 1.6;
    margin: 1em 0;
}
.post-body code {
    font-family: 'Consolas', 'Courier New', monospace;
}
.post-body img {
    max-width: 100%;
    border-radius: 12px;
    margin: 1em 0;
}

/* 底部工具列 */
.post-footer-bar {
    margin-top: 28px;
    padding-top: 14px;
    border-top: 1px solid #eef3f8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.post-footer-bar .share {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    color: #7a8fa4;
}
.post-footer-bar .share a {
    color: #7a8fa4;
    font-size: 1.1rem;
    text-decoration: none;
    transition: color 0.2s;
}
.post-footer-bar .share a:hover {
    color: #2563eb;
}

/* 留言區塊 */
.comment-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #e4ecf6;
}
.comment-heading {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0b1929;
    margin-bottom: 20px;
}
.comment-alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.88rem;
    margin-bottom: 16px;
}
.comment-alert.success {
    background: #e6f7e6;
    border: 1px solid #b8e6b8;
    color: #1a6b1a;
}
.comment-alert.error {
    background: #fff3cd;
    border: 1px solid #ffe082;
    color: #856404;
}
.comment-form {
    margin-bottom: 28px;
    padding: 22px;
    background: #f5f9ff;
    border-radius: 16px;
    border: 1px solid #e4ecf6;
}
.comment-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dce4ee;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.comment-form textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.comment-captcha {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.comment-captcha .captcha-expr {
    font-size: 1rem;
    font-weight: 700;
    color: #0b1929;
    background: #e8edf6;
    padding: 6px 16px;
    border-radius: 6px;
    -webkit-user-select: none;
    user-select: none;
}
.comment-captcha input {
    width: 70px;
    padding: 8px 12px;
    border: 1px solid #dce4ee;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    transition: border-color 0.2s;
}
.comment-captcha input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.comment-submit {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.comment-login-hint {
    padding: 16px;
    background: #f5f9ff;
    border-radius: 12px;
    text-align: center;
    font-size: 0.88rem;
    color: #8aa0b8;
    margin-bottom: 20px;
    border: 1px solid #e4ecf6;
}
.comment-login-hint a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}
.comment-login-hint a:hover {
    text-decoration: underline;
}
.comment-item {
    padding: 16px 0;
    border-bottom: 1px solid #f0f3f8;
}
.comment-item:last-child {
    border-bottom: none;
}
.comment-item .comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.comment-item .comment-header strong {
    font-size: 0.88rem;
    color: #0b1929;
}
.comment-item .comment-header span {
    font-size: 0.78rem;
    color: #aab8c8;
}
.comment-item p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #3a4f66;
}

/* RWD */
@media (max-width: 820px) {
    .post-layout { flex-direction: column; }
    .post-sidebar { position: static; width: 100%; max-width: 100%; }
    .post-header h1 { font-size: 1.4rem; }
    .article-card { padding: 20px; }
    .post-item .post-thumb { flex: 0 0 120px; }
}
@media (max-width: 520px) {
    .post-layout { padding: 12px 0 24px; gap: 24px; }
    .post-header h1 { font-size: 1.2rem; }
    .article-card { padding: 16px; }
    .post-header .post-meta { flex-direction: column; gap: 4px; }
    .comment-form { padding: 16px; }
    .post-item { flex-direction: column; gap: 10px; padding: 14px 16px; }
    .post-item .post-thumb { flex: 0 0 100%; width: 100%; }
}
