/* 文章詳細頁專屬樣式 */
.article-detail-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 1rem;
}

.top-navigation-container {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.pagination-nav {
    display: flex;
    gap: 0.75rem;
}

.pagination-nav-bottom {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.nav-button {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: 2px solid #667eea;
    white-space: nowrap;
}

.nav-button:hover:not(.nav-disabled) {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.nav-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: #cbd5e0;
    color: #a0aec0;
}

.article-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4.5rem 2rem 3rem 2rem;
    border-radius: 20px;
    margin-bottom: 3rem;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    position: relative;
}

/* 文章標題區的編輯刪除按鈕 */
.article-header-actions {
    position: absolute;
    top: 1rem;
    right: 4.5rem;
    display: flex;
    gap: 0.5rem;
}

.article-header h1 {
    font-size: 2.5rem;
    margin: 0 0 1rem 0;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    font-size: 1rem;
    opacity: 0.95;
    flex-wrap: wrap;
}

.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.article-meta .author-link {
    color: white;
    text-decoration: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    font-weight: 600;
    padding-bottom: 2px;
}

.article-meta .author-link:hover {
    border-bottom-color: white;
    transform: translateY(-1px);
}

.article-content-wrapper {
    background: white;
    padding: 3rem 2.5rem;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.9;
    color: #333;
}

/* Markdown 樣式 */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #2d3748;
}

.article-content h1 {
    font-size: 2rem;
}

.article-content h2 {
    font-size: 1.75rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.article-content h3 {
    font-size: 1.5rem;
}

.article-content h4 {
    font-size: 1.25rem;
}

.article-content p {
    margin-bottom: 1rem;
}

.article-content ul,
.article-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content code {
    background: #f7fafc;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    color: #e53e3e;
}

.article-content pre {
    background: #282c34;
    color: #abb2bf;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
    font-weight: bold;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Pygments 語法高亮樣式 (One Dark 主題) */
.codehilite {
    background: #282c34;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    overflow-x: auto;
    margin: 1rem 0;
    font-weight: bold;
}

.codehilite pre {
    margin: 0;
    padding: 0;
    background: transparent;
}

.codehilite .hll {
    background-color: #3e4451
}

.codehilite .c {
    color: #5c6370;
    font-style: italic
}

/* Comment */
.codehilite .err {
    color: #e06c75
}

/* Error */
.codehilite .k {
    color: #c678dd
}

/* Keyword */
.codehilite .l {
    color: #98c379
}

/* Literal */
.codehilite .n {
    color: #abb2bf
}

/* Name */
.codehilite .o {
    color: #56b6c2
}

/* Operator */
.codehilite .p {
    color: #abb2bf
}

/* Punctuation */
.codehilite .ch {
    color: #5c6370;
    font-style: italic
}

/* Comment.Hashbang */
.codehilite .cm {
    color: #5c6370;
    font-style: italic
}

/* Comment.Multiline */
.codehilite .cp {
    color: #5c6370;
    font-style: italic
}

/* Comment.Preproc */
.codehilite .cpf {
    color: #5c6370;
    font-style: italic
}

/* Comment.PreprocFile */
.codehilite .c1 {
    color: #5c6370;
    font-style: italic
}

/* Comment.Single */
.codehilite .cs {
    color: #5c6370;
    font-style: italic
}

/* Comment.Special */
.codehilite .gd {
    color: #e06c75
}

/* Generic.Deleted */
.codehilite .ge {
    font-style: italic
}

/* Generic.Emph */
.codehilite .gi {
    color: #98c379
}

/* Generic.Inserted */
.codehilite .gs {
    font-weight: bold
}

/* Generic.Strong */
.codehilite .gu {
    color: #56b6c2
}

/* Generic.Subheading */
.codehilite .kc {
    color: #c678dd
}

/* Keyword.Constant */
.codehilite .kd {
    color: #c678dd
}

/* Keyword.Declaration */
.codehilite .kn {
    color: #c678dd
}

/* Keyword.Namespace */
.codehilite .kp {
    color: #c678dd
}

/* Keyword.Pseudo */
.codehilite .kr {
    color: #c678dd
}

/* Keyword.Reserved */
.codehilite .kt {
    color: #e5c07b
}

/* Keyword.Type */
.codehilite .ld {
    color: #98c379
}

/* Literal.Date */
.codehilite .m {
    color: #d19a66
}

/* Literal.Number */
.codehilite .s {
    color: #98c379
}

/* Literal.String */
.codehilite .na {
    color: #d19a66
}

/* Name.Attribute */
.codehilite .nb {
    color: #e5c07b
}

/* Name.Builtin */
.codehilite .nc {
    color: #e5c07b
}

/* Name.Class */
.codehilite .no {
    color: #d19a66
}

/* Name.Constant */
.codehilite .nd {
    color: #61afef
}

/* Name.Decorator */
.codehilite .ni {
    color: #abb2bf
}

/* Name.Entity */
.codehilite .ne {
    color: #e06c75
}

/* Name.Exception */
.codehilite .nf {
    color: #61afef
}

/* Name.Function */
.codehilite .nl {
    color: #e06c75
}

/* Name.Label */
.codehilite .nn {
    color: #abb2bf
}

/* Name.Namespace */
.codehilite .nx {
    color: #abb2bf
}

/* Name.Other */
.codehilite .py {
    color: #e06c75
}

/* Name.Property */
.codehilite .nt {
    color: #e06c75
}

/* Name.Tag */
.codehilite .nv {
    color: #e06c75
}

/* Name.Variable */
.codehilite .ow {
    color: #56b6c2
}

/* Operator.Word */
.codehilite .w {
    color: #abb2bf
}

/* Text.Whitespace */
.codehilite .mb {
    color: #d19a66
}

/* Literal.Number.Bin */
.codehilite .mf {
    color: #d19a66
}

/* Literal.Number.Float */
.codehilite .mh {
    color: #d19a66
}

/* Literal.Number.Hex */
.codehilite .mi {
    color: #d19a66
}

/* Literal.Number.Integer */
.codehilite .mo {
    color: #d19a66
}

/* Literal.Number.Oct */
.codehilite .sa {
    color: #98c379
}

/* Literal.String.Affix */
.codehilite .sb {
    color: #98c379
}

/* Literal.String.Backtick */
.codehilite .sc {
    color: #98c379
}

/* Literal.String.Char */
.codehilite .dl {
    color: #98c379
}

/* Literal.String.Delimiter */
.codehilite .sd {
    color: #98c379
}

/* Literal.String.Doc */
.codehilite .s2 {
    color: #98c379
}

/* Literal.String.Double */
.codehilite .se {
    color: #d19a66
}

/* Literal.String.Escape */
.codehilite .sh {
    color: #98c379
}

/* Literal.String.Heredoc */
.codehilite .si {
    color: #98c379
}

/* Literal.String.Interpol */
.codehilite .sx {
    color: #98c379
}

/* Literal.String.Other */
.codehilite .sr {
    color: #98c379
}

/* Literal.String.Regex */
.codehilite .s1 {
    color: #98c379
}

/* Literal.String.Single */
.codehilite .ss {
    color: #98c379
}

/* Literal.String.Symbol */
.codehilite .bp {
    color: #e5c07b
}

/* Name.Builtin.Pseudo */
.codehilite .fm {
    color: #61afef
}

/* Name.Function.Magic */
.codehilite .vc {
    color: #e06c75
}

/* Name.Variable.Class */
.codehilite .vg {
    color: #e06c75
}

/* Name.Variable.Global */
.codehilite .vi {
    color: #e06c75
}

/* Name.Variable.Instance */
.codehilite .vm {
    color: #e06c75
}

/* Name.Variable.Magic */
.codehilite .il {
    color: #d19a66
}

/* Literal.Number.Integer.Long */

.article-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: #4a5568;
    font-style: italic;
}

.article-content a {
    color: #667eea;
    text-decoration: underline;
}

.article-content a:hover {
    color: #764ba2;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.article-content table th,
.article-content table td {
    border: 1px solid #e2e8f0;
    padding: 0.75rem;
    text-align: left;
}

.article-content table th {
    background: #f7fafc;
    font-weight: 600;
}

.article-content hr {
    border: none;
    border-top: 2px solid #e2e8f0;
    margin: 2rem 0;
}

.article-footer {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.footer-actions-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    flex-wrap: wrap;
}

.back-button {
    display: inline-flex;
    align-items: center;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.back-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}


/* Icon 按鈕樣式 - 低調設計 */
.action-icon-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.25s ease;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.action-icon-button svg {
    transition: all 0.25s ease;
}

/* 編輯按鈕 */
.edit-icon-button {
    color: rgba(255, 255, 255, 0.9);
}

.edit-icon-button:hover {
    background: rgba(72, 187, 120, 0.9);
    border-color: rgba(72, 187, 120, 1);
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.edit-icon-button:active {
    transform: translateY(0) scale(1);
}

/* 刪除按鈕 */
.delete-icon-button {
    color: rgba(255, 255, 255, 0.9);
}

.delete-icon-button:hover {
    background: rgba(245, 101, 101, 0.9);
    border-color: rgba(245, 101, 101, 1);
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.delete-icon-button:active {
    transform: translateY(0) scale(1);
}

/* Tooltip 效果 */
.action-icon-button::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    z-index: 10;
}

/* Tooltip 小三角形 */
.action-icon-button::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(0, 0, 0, 0.85);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    z-index: 10;
}

.action-icon-button:hover::after,
.action-icon-button:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Message 動畫 */
.message-container {
    max-width: 900px;
    margin: 1rem auto;
    padding: 0 1rem;
}

.message-item {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    animation: slideDown 0.5s ease;
}

.message-success {
    background: #c6f6d5;
    color: #22543d;
    border-left: 4px solid #38a169;
}

.message-error {
    background: #fed7d7;
    color: #742a2a;
    border-left: 4px solid #e53e3e;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .article-header {
        padding: 3.5rem 1.5rem 2.5rem 1.5rem;
    }

    .article-header h1 {
        font-size: 2rem;
    }

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    /* 手機版：編輯刪除按鈕組調整位置，為分享按鈕留出空間 */
    .article-header-actions {
        top: 0.75rem;
        right: 3.25rem;
        gap: 0.25rem;
    }

    .action-icon-button {
        width: 32px;
        height: 32px;
    }

    .action-icon-button svg {
        width: 16px;
        height: 16px;
    }

    .article-content-wrapper {
        padding: 2rem 1.5rem;
    }

    .top-navigation-container {
        flex-direction: column;
        align-items: stretch;
    }

    .pagination-nav {
        width: 100%;
        justify-content: space-between;
    }

    .pagination-nav-bottom {
        flex-direction: row;
        gap: 0.5rem;
    }

    .nav-button {
        flex: 1;
        justify-content: center;
        font-size: 0.875rem;
        padding: 0.625rem 1rem;
    }

    .footer-actions-container {
        justify-content: center;
    }

    .back-button {
        width: 100%;
        justify-content: center;
    }
}

/* ===== 分享功能樣式 ===== */
.share-article-icon-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    color: white;
}

.share-article-icon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 分享選單樣式 */
.share-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.share-menu-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    position: relative;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.share-menu-content h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
}

.share-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.share-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.share-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.share-button.facebook .share-icon {
    background: #1877f2;
}

.share-button.facebook:hover {
    border-color: #1877f2;
    color: #1877f2;
}

.share-button.twitter .share-icon {
    background: #000000;
}

.share-button.twitter:hover {
    border-color: #000000;
    color: #000000;
}

.share-button.line .share-icon {
    background: #00B900;
}

.share-button.line:hover {
    border-color: #00B900;
    color: #00B900;
}

.share-button.copy-link .share-icon {
    background: #6366f1;
    font-size: 1.25rem;
}

.share-button.copy-link:hover {
    border-color: #6366f1;
    color: #6366f1;
}

.share-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s;
}

.share-close:hover {
    background: #e5e7eb;
    color: #1f2937;
    transform: rotate(90deg);
}

@media (max-width: 768px) {
    .share-article-icon-btn {
        top: 0.75rem;
        right: 0.75rem;
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .share-buttons {
        grid-template-columns: 1fr;
    }
}

/* ===== 留言區樣式 ===== */
.comments-section {
    margin-top: 3rem;
    padding: 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.comments-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

/* 留言表單 */
.comment-form-container {
    margin-bottom: 2rem;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-form .form-control {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s;
    resize: vertical;
}

.comment-form .form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.submit-comment-btn {
    align-self: flex-end;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.submit-comment-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* 登入提示 */
.login-prompt {
    padding: 1.5rem;
    background: #f7fafc;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 2rem;
}

.login-prompt p {
    margin: 0;
    color: #4a5568;
    font-size: 1rem;
}

.login-prompt a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.login-prompt a:hover {
    text-decoration: underline;
}

/* 留言列表 */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment-item {
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    transition: all 0.3s;
    scroll-margin-top: 100px;
}

.comment-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

/* 錨點目標高亮效果 */
.comment-item:target,
.reply-item:target {
    background: #f0f4ff;
    border-color: #667eea;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    animation: highlight-pulse 2s ease-in-out;
}

@keyframes highlight-pulse {
    0% {
        box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5);
    }
    100% {
        box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    }
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author-icon {
    font-size: 1.25rem;
}

.author-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 1rem;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.comment-time {
    font-size: 0.875rem;
    color: #6b7280;
}

.comment-delete-btn {
    font-size: 0.875rem;
    color: #ef4444;
    text-decoration: none;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.comment-delete-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.comment-content {
    color: #374151;
    line-height: 1.6;
    font-size: 1rem;
}

/* 回覆留言 */
.replies-list {
    margin-top: 1rem;
    padding-left: 1.5rem;
    border-left: 3px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.reply-item {
    padding: 1rem;
    background: white;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s;
    scroll-margin-top: 100px;
}

.reply-item:hover {
    border-color: #667eea;
}

/* 無留言提示 */
.no-comments {
    text-align: center;
    padding: 3rem 2rem;
    color: #6b7280;
}

.no-comments p {
    margin: 0;
    font-size: 1.125rem;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .comments-section {
        padding: 1.5rem;
    }

    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .replies-list {
        padding-left: 1rem;
    }

    .submit-comment-btn {
        width: 100%;
    }
}

/* ===== 點讚區樣式 (Facebook 風格) ===== */
.article-like-section {
    position: relative;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 0.5rem 0;
    margin: 1.5rem 0;
    border-top: 1px solid #e4e6eb;
    border-bottom: 1px solid #e4e6eb;
    background: transparent;
}

.like-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    background: transparent;
    color: #65676b;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: background-color 0.1s ease;
    position: relative;
}

.like-button:hover:not(.disabled) {
    background-color: rgba(0, 0, 0, 0.05);
}

.like-button:active:not(.disabled) {
    background-color: rgba(0, 0, 0, 0.1);
}

.like-button.liked {
    color: #e41e3f;
}

.like-button.liked:hover {
    background-color: rgba(228, 30, 63, 0.1);
}

/* 移除 disabled 樣式，改用 own-article 樣式讓按鈕看起來可點擊 */
.like-button.own-article {
    color: #65676b;
    cursor: pointer;
}

.like-button.own-article:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.like-icon {
    font-size: 1.125rem;
    line-height: 1;
    transition: transform 0.1s ease;
}

.like-button.liked .like-icon {
    animation: fb-like-bounce 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.like-text {
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.3333;
}

/* 點讚數字顯示（按鈕外部，不可點擊） */
.like-count-display {
    display: inline;
    color: #65676b;
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.3333;
    margin-left: 0.25rem;
    pointer-events: none;
    user-select: none;
}

/* Facebook 風格的點讚彈跳動畫 */
@keyframes fb-like-bounce {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(0.95);
    }
    75% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .article-like-section {
        padding: 0.375rem 0;
        margin: 1rem 0;
    }

    .like-button {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }

    .like-icon {
        font-size: 1rem;
    }

    .like-text {
        font-size: 0.875rem;
    }

    .like-count {
        font-size: 0.875rem;
    }
}

/* ===== 點讚訊息提示 ===== */
/* Facebook 風格浮動提示 */
.like-message {
    /* position 在 JS 中動態設置為 fixed */
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    z-index: 10000;
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    pointer-events: none;
}

/* 小三角形箭頭 */
.like-message::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
}

.like-message.success {
    background: rgba(50, 50, 50, 0.92);
    color: white;
}

.like-message.success::after {
    border-top: 6px solid rgba(50, 50, 50, 0.92);
}

.like-message.error {
    background: rgba(220, 38, 38, 0.92);
    color: white;
}

.like-message.error::after {
    border-top: 6px solid rgba(220, 38, 38, 0.92);
}

.like-message.info {
    background: rgba(59, 130, 246, 0.92);
    color: white;
}

.like-message.info::after {
    border-top: 6px solid rgba(59, 130, 246, 0.92);
}

.like-message.show {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

@media (max-width: 768px) {
    .like-message {
        font-size: 0.8rem;
        padding: 0.4rem 0.875rem;
    }
}

/* ===== Back to Top 按鈕 ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }
}/* ===== 相似文章推薦 ===== */
.similar-articles-section {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 2px solid #e0e0e0;
}

.similar-articles-section .section-title {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: #333;
    text-align: center;
}

.similar-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.similar-article-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.similar-article-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.similar-article-card-link:hover .similar-article-card {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.similar-article-card .article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.similar-article-card .article-author {
    color: #667eea;
    font-weight: 500;
}

.similar-article-card .article-date {
    color: #999;
}

.similar-article-card .article-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    line-height: 1.4;
}

.similar-article-card .article-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

.similar-article-card .article-title a:hover {
    color: #667eea;
}

.similar-article-card .article-excerpt {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

.similar-article-card .article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    min-height: 2rem;
}

.similar-article-card .tag {
    padding: 0.25rem 0.75rem;
    background: #f0f0f0;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #666;
    text-decoration: none;
    transition: all 0.2s;
}

.similar-article-card .tag:hover {
    background: #667eea;
    color: white;
}

.similar-article-card .article-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #999;
}

.similar-article-card .stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

@media (max-width: 768px) {
    .similar-articles-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .similar-article-card {
        padding: 1.25rem;
    }
}
