/* ===== Blog Hero (列表頁) ===== */
.blog-hero {
    position: relative;
    min-height: 380px;
    padding-top: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    text-align: center;
    overflow: hidden;
}
.blog-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(13,33,55,0.3) 0%, rgba(13,33,55,0.7) 100%);
}
.blog-hero-overlay::before {
    content: '';
    position: absolute;
    width: 280px;
    height: 280px;
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 50%;
    top: -60px;
    right: -60px;
}
.blog-hero-overlay::after {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    border: 2px solid rgba(255,255,255,0.06);
    border-radius: 50%;
    bottom: -40px;
    left: -40px;
}
.blog-hero h1 {
    font-size: 2.6rem;
    color: #fff;
    margin-bottom: 0.5rem;
    position: relative;
    text-shadow: 0 2px 15px rgba(0,0,0,0.2);
}
.blog-hero h1::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--warm);
    margin: 0.8rem auto 0;
    border-radius: 2px;
}
.blog-hero p {
    color: rgba(255,255,255,0.8);
    font-size: 1.1rem;
    position: relative;
    margin-top: 0.6rem;
}

/* ===== Blog Content Area ===== */
.blog-content {
    padding: 0 0 5rem;
    background: var(--light-bg);
}

/* ===== Featured Card ===== */
.featured-card {
    margin-top: 2.5rem;
    margin-bottom: 2.5rem;
}
.featured-link {
    display: flex;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 6px 30px rgba(0,0,0,0.06);
    transition: all 0.4s;
    border: 1px solid rgba(0,0,0,0.03);
}
.featured-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 50px rgba(0,0,0,0.1);
    color: inherit;
}
.featured-img {
    position: relative;
    width: 50%;
    height: 340px;
    overflow: hidden;
    flex-shrink: 0;
}
.featured-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s;
}
.featured-link:hover .featured-img img { transform: scale(1.05); }
.featured-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 60%, rgba(0,0,0,0.08) 100%);
    pointer-events: none;
}
.featured-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cream);
    font-size: 4rem;
    color: var(--warm);
}
.featured-body {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}
.featured-body h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.5;
    margin-bottom: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.featured-body p {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.featured-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 1.2rem;
}
.featured-meta i {
    margin-right: 0.3rem;
    color: var(--warm);
}
.featured-read {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--coral);
    font-weight: 600;
    font-size: 0.9rem;
    transition: gap 0.3s;
}
.featured-link:hover .featured-read { gap: 0.8rem; }

/* ===== Blog Grid Cards ===== */
.blog-content .article-card {
    border: 1px solid rgba(0,0,0,0.04);
}
.blog-content .article-card:hover {
    border-color: rgba(26,54,93,0.2);
}

/* ===== Empty State ===== */
.blog-empty {
    text-align: center;
    padding: 5rem 2rem;
}
.blog-empty i {
    font-size: 4rem;
    color: var(--warm);
    opacity: 0.4;
    display: block;
    margin-bottom: 1rem;
}
.blog-empty h3 {
    font-size: 1.4rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
}
.blog-empty p {
    color: var(--text-light);
    font-size: 1rem;
}

/* ===== Pagination ===== */
.pagination-wrap {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}
.pagination .page-link {
    color: var(--dark);
    border-color: #c8e6c9;
    padding: 0.5rem 1rem;
    margin: 0 0.2rem;
    border-radius: 10px;
    transition: all 0.3s;
    font-weight: 500;
    background: #fff;
}
.pagination .page-item.active .page-link {
    background: var(--warm);
    border-color: var(--warm);
    color: #fff;
    box-shadow: 0 4px 12px rgba(26,54,93,0.3);
}
.pagination .page-link:hover {
    background: var(--cream);
    border-color: var(--warm);
    color: var(--warm);
}

/* ===== Article Hero Banner (詳情頁) ===== */
.article-hero {
    position: relative;
    min-height: 480px;
    padding-top: 64px;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
    padding-bottom: 3.5rem;
    overflow: hidden;
}
.article-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(13,33,55,0.15) 0%, rgba(13,33,55,0.75) 100%);
}
.article-hero .container {
    z-index: 2;
}
.article-breadcrumb {
    margin-bottom: 1.5rem;
}
.article-breadcrumb .breadcrumb {
    margin-bottom: 0;
    font-size: 0.85rem;
}
.article-breadcrumb .breadcrumb-item a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.2s;
}
.article-breadcrumb .breadcrumb-item a:hover { color: #fff; }
.article-breadcrumb .breadcrumb-item.active { color: rgba(255,255,255,0.5); }
.article-breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,0.4); }

.article-hero-content {
    max-width: 800px;
}
.article-hero-content h1 {
    font-size: 2.4rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.5;
    margin-bottom: 1.2rem;
    text-shadow: 0 2px 15px rgba(0,0,0,0.2);
}
.article-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    color: rgba(255,255,255,0.8);
    font-size: 0.88rem;
}
.article-hero-meta i {
    margin-right: 0.3rem;
    color: var(--warm);
}

/* ===== Article Detail Body ===== */
.article-detail {
    padding: 0 0 4rem;
    background: var(--light-bg);
}
.article-card-wrap {
    background: #fff;
    border-radius: 24px;
    padding: 3rem 3.5rem;
    box-shadow: 0 10px 50px rgba(0,0,0,0.06);
}

.article-content {
    font-size: 1.08rem;
    line-height: 2;
    color: #444;
    overflow: hidden;
}
.article-content h2 {
    font-size: 1.6rem;
    margin: 3rem 0 1rem;
    color: var(--dark);
    border-left: 4px solid var(--warm);
    padding-left: 1rem;
    line-height: 1.6;
    font-weight: 700;
}
.article-content h3 {
    font-size: 1.3rem;
    margin: 2.5rem 0 0.8rem;
    color: var(--dark);
    font-weight: 700;
    border-left: 3px solid rgba(26,54,93,0.4);
    padding-left: 0.8rem;
}
.article-content h4 {
    font-size: 1.15rem;
    margin: 2rem 0 0.6rem;
    color: var(--dark);
    font-weight: 600;
    position: relative;
    padding-left: 1rem;
}
.article-content h4::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.35em;
    width: 6px;
    height: 6px;
    background: var(--warm);
    border-radius: 50%;
}
.article-content h5 {
    font-size: 1.05rem;
    margin: 1.8rem 0 0.5rem;
    color: #555;
    font-weight: 600;
}
.article-content h6 {
    font-size: 0.95rem;
    margin: 1.5rem 0 0.5rem;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.article-content p { margin-bottom: 1.5rem; }
.article-content img {
    max-width: 100% !important;
    width: auto;
    height: auto !important;
    border-radius: 14px;
    margin: 2rem 0;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}
.article-content .se-image-container {
    max-width: 100% !important;
}
.article-content .se-image-container figure {
    max-width: 100% !important;
}
.article-content figure,
.article-content p > img,
.article-content span[style],
.article-content div[style] {
    max-width: 100% !important;
    box-sizing: border-box;
}
.article-content figure img {
    width: 100%;
}
.article-content blockquote {
    background: var(--cream);
    border-left: 4px solid var(--warm);
    padding: 1.8rem 2rem 1.8rem 3rem;
    border-radius: 0 16px 16px 0;
    margin: 2.5rem 0;
    font-style: italic;
    color: var(--dark);
    position: relative;
}
.article-content blockquote::before {
    content: '\201C';
    font-family: 'Noto Serif TC', serif;
    font-size: 4rem;
    color: var(--warm);
    opacity: 0.3;
    position: absolute;
    top: 0.2rem;
    left: 0.8rem;
    line-height: 1;
}
.article-content a {
    color: var(--coral);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}
.article-content a:hover { color: var(--warm); }
.article-content ul, .article-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}
.article-content li { margin-bottom: 0.5rem; }

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.98rem;
    line-height: 1.7;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}
.article-content table thead th {
    background: linear-gradient(135deg, var(--warm) 0%, #132d4f 100%);
    color: #fff;
    font-weight: 600;
    padding: 0.9rem 1.2rem;
    text-align: left;
    letter-spacing: 0.5px;
    border: none;
    white-space: nowrap;
}
.article-content table thead th:first-child {
    border-radius: 12px 0 0 0;
}
.article-content table thead th:last-child {
    border-radius: 0 12px 0 0;
}
.article-content table tbody td {
    padding: 0.85rem 1.2rem;
    border-bottom: 1px solid #d4edda;
    vertical-align: top;
    color: #444;
}
.article-content table tbody tr:last-child td {
    border-bottom: none;
}
.article-content table tbody tr:nth-child(even) {
    background: #f0f5ff;
}
.article-content table tbody tr:hover {
    background: #ebf4ff;
    transition: background 0.2s;
}
.article-content table tbody td:first-child {
    font-weight: 600;
    color: var(--dark);
    text-align: center;
    white-space: nowrap;
}
.article-content table caption {
    caption-side: bottom;
    padding: 0.8rem 0;
    font-size: 0.88rem;
    color: #999;
    font-style: italic;
}
@media (max-width: 768px) {
    .article-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 10px;
    }
    .article-content table thead th,
    .article-content table tbody td {
        padding: 0.7rem 0.9rem;
        font-size: 0.92rem;
        min-width: 80px;
    }
}

/* ===== Main Layout (Content + Sidebar) ===== */
.article-main-layout {
    display: flex;
    gap: 2.5rem;
    max-width: 100%;
    margin-top: -3rem;
    position: relative;
    z-index: 3;
}
.article-main-layout .article-card-wrap {
    flex: 1;
    min-width: 0;
    margin: 0;
}

/* ===== Inline TOC (embedded in article) ===== */
.toc-inline {
    background: #fcfcfc;
    border: 1px solid rgba(26,54,93,0.2);
    border-radius: 16px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 2.5rem;
}
.toc-inline-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--dark);
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--warm);
    margin-bottom: 0.8rem;
}
.toc-inline-header i:first-child {
    color: var(--warm);
}
.toc-inline-toggle {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.2rem;
    font-size: 0.85rem;
    transition: transform 0.3s;
}
.toc-inline-toggle[aria-expanded="false"] i {
    transform: rotate(180deg);
}
.toc-inline-nav {
    max-height: 400px;
    overflow-y: auto;
    transition: max-height 0.35s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(26,54,93,0.3) transparent;
}
.toc-inline-nav::-webkit-scrollbar {
    width: 5px;
}
.toc-inline-nav::-webkit-scrollbar-track {
    background: transparent;
}
.toc-inline-nav::-webkit-scrollbar-thumb {
    background: rgba(26,54,93,0.3);
    border-radius: 3px;
}
.toc-inline-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(26,54,93,0.5);
}
.toc-inline-nav.collapsed {
    max-height: 0;
}
.toc-inline-list {
    list-style: none;
    padding: 0;
    margin: 0;
    columns: 1;
}
.toc-inline-item {
    margin-bottom: 0.15rem;
    break-inside: avoid;
}
.toc-inline-item.toc-level-3 {
    padding-left: 1.2rem;
}
.toc-inline-item.toc-level-4 {
    padding-left: 2.4rem;
}
.toc-inline-link {
    display: block;
    padding: 0.35rem 0.6rem;
    font-size: 0.88rem;
    color: var(--text-light);
    text-decoration: none;
    border-left: 2px solid transparent;
    border-radius: 0 6px 6px 0;
    transition: all 0.2s;
    line-height: 1.6;
}
.toc-inline-link:hover {
    color: var(--dark);
    background: rgba(255,255,255,0.6);
}
.toc-inline-link.active {
    color: var(--coral);
    border-left-color: var(--warm);
    background: rgba(255,255,255,0.5);
    font-weight: 600;
}

/* ===== Sidebar ===== */
.article-sidebar {
    width: 320px;
    flex-shrink: 0;
    margin-top: 0;
}
.sidebar-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 6px 25px rgba(0,0,0,0.05);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0,0,0,0.04);
}
.sidebar-card-header {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
    padding-bottom: 0.8rem;
    margin-bottom: 0.8rem;
    border-bottom: 2px solid var(--warm);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.sidebar-card-header i {
    color: var(--warm);
}
.sidebar-article-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-article-list li {
    margin-bottom: 0.6rem;
}
.sidebar-article-list li:last-child {
    margin-bottom: 0;
}
.sidebar-article-item {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding: 0.5rem;
    border-radius: 12px;
    transition: all 0.25s;
}
.sidebar-article-item:hover {
    background: var(--cream);
    color: inherit;
    transform: translateX(3px);
}
.sidebar-article-thumb {
    width: 64px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}
.sidebar-article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sidebar-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cream);
    color: var(--warm);
    font-size: 1.2rem;
}
.sidebar-article-info {
    flex: 1;
    min-width: 0;
}
.sidebar-article-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.5;
}
.sidebar-article-info time {
    font-size: 0.78rem;
    color: var(--text-light);
}
.sidebar-sticky {
    position: sticky;
    top: 90px;
}

@media (min-width: 1200px) {
    .sidebar-card:first-child {
        position: sticky;
        top: 90px;
    }
}
@media (max-width: 991.98px) {
    .article-main-layout {
        flex-direction: column;
    }
    .article-sidebar {
        width: 100%;
    }
}

/* ===== Author Card ===== */
.article-author-card {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-top: 3rem;
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: 16px;
    border: 1px solid rgba(26,54,93,0.15);
}
.author-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 15px rgba(26,54,93,0.2);
}
.author-info strong {
    font-size: 1rem;
    color: var(--dark);
    display: block;
    margin-bottom: 0.2rem;
}
.author-info p {
    font-size: 0.88rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.5;
}

/* ===== Share Buttons ===== */
.share-buttons {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
    text-align: center;
}
.share-label {
    display: block;
    font-size: 0.88rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    font-weight: 500;
}
.share-links {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.4rem;
    border-radius: 50px;
    border: 1px solid #c8e6c9;
    background: #fff;
    color: var(--dark);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.3s;
    cursor: pointer;
}
.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}
.share-btn.facebook { border-color: #dbe2f0; }
.share-btn.facebook:hover { background: #1877f2; color: #fff; border-color: #1877f2; box-shadow: 0 6px 18px rgba(24,119,242,0.3); }
.share-btn.line { border-color: #d4eadc; }
.share-btn.line:hover { background: #06c755; color: #fff; border-color: #06c755; box-shadow: 0 6px 18px rgba(6,199,85,0.3); }

/* ===== Nav Prev/Next ===== */
.article-nav {
    margin: 2.5rem 0 0;
    display: flex;
    justify-content: space-between;
    gap: 1.2rem;
}
.article-nav a {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 16px;
    text-decoration: none;
    color: var(--dark);
    transition: all 0.3s;
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}
.article-nav a:hover {
    border-color: var(--warm);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
.article-nav .nav-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--warm);
    font-size: 1.1rem;
    transition: all 0.3s;
}
.article-nav a:hover .nav-arrow {
    background: var(--warm);
    color: #fff;
}
.article-nav .nav-label {
    font-size: 0.8rem;
    color: var(--text-light);
    display: block;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.article-nav .nav-title {
    font-weight: 600;
    margin-top: 0.3rem;
    display: block;
    font-size: 0.95rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-nav .nav-next { text-align: right; flex-direction: row-reverse; }

/* ===== Related Articles ===== */
.related-section {
    padding: 4.5rem 0;
    background: var(--light-bg);
}

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
    .blog-hero { min-height: 320px; }
    .blog-hero h1 { font-size: 2.2rem; }
    .featured-link { flex-direction: column; }
    .featured-img { width: 100%; min-height: 260px; }
    .featured-body { padding: 2rem; }
    .article-hero { min-height: 400px; }
    .article-hero-content h1 { font-size: 2rem; }
    .article-card-wrap { padding: 2.5rem 2rem; }
    .article-main-layout { margin-top: -2rem; }
}
@media (max-width: 767.98px) {
    .blog-hero { min-height: 280px; }
    .blog-hero h1 { font-size: 1.8rem; }
    .featured-img { min-height: 200px; max-height: 280px; }
    .featured-body { padding: 1.5rem; }
    .featured-body h2 { font-size: 1.3rem; }
    .article-hero { min-height: 350px; padding-bottom: 2.5rem; }
    .article-hero-content h1 { font-size: 1.5rem; }
    .article-hero-meta { gap: 0.8rem; font-size: 0.82rem; }
    .article-card-wrap { padding: 2rem 1.2rem; border-radius: 18px; }
    .article-main-layout { margin-top: -1.5rem; }
    .article-content { font-size: 1rem; }
    .article-content blockquote { padding: 1.2rem 1.5rem 1.2rem 2.5rem; }
    .article-author-card { flex-direction: column; text-align: center; }
    .article-nav { flex-direction: column; }
    .article-nav .nav-next { flex-direction: row-reverse; text-align: right; }
    .share-links { gap: 0.5rem; }
    .share-btn { padding: 0.5rem 1rem; font-size: 0.82rem; }
}
