/* ========== scroll to top (link/tail.php .scroll-top-btn) ========== */
/* 颜色来自 link/_themes.php → link_render_theme_style() 注入的 :root 变量 */
.scroll-top-btn {
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 10002;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--gradient-accent);
    color: var(--on-accent);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(var(--shadow-rgb), 0.28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity var(--ease, 0.2s ease), visibility var(--ease, 0.2s ease), transform var(--ease, 0.2s ease), filter var(--ease, 0.2s ease), box-shadow var(--ease, 0.2s ease);
}

.scroll-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    filter: brightness(1.08);
    box-shadow: 0 6px 22px rgba(var(--shadow-rgb), 0.35);
}

.scroll-top-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ========== view content blocks (123.html classes) ========== */
/* 颜色走 :root 主题变量（link_render_theme_style / 站点主题） */

.main-content {
    margin: 0 0 28px;
    color: var(--muted, #555);
    font-size: 1rem;
    line-height: 1.8;
}

.main-content p {
    margin: 0 0 1em;
}

.main-content p:last-child {
    margin-bottom: 0;
}

.main-content b,
.main-content strong {
    color: var(--ink, #222);
    font-weight: 700;
}

/* ── 뉴스 모음 ── */
.news-section,
.videos-section,
.images-section {
    margin: 28px 0 8px;
}

.news-section > h2,
.videos-section > h2,
.images-section > h2 {
    margin: 0 0 16px;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--ink, #222);
    letter-spacing: -0.02em;
}

.news-section > h2::after,
.videos-section > h2::after,
.images-section > h2::after {
    content: "";
    display: block;
    width: 40px;
    height: 3px;
    margin-top: 10px;
    background: var(--accent, #222);
    border-radius: 2px;
}

.news-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--line, #e5e7eb);
    border-radius: var(--radius-sm, 8px);
    overflow: hidden;
    background: var(--surface, #fff);
}

.news-item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line, #e5e7eb);
}

.news-item:last-child {
    border-bottom: 0;
}

.news-item:nth-child(even) {
    background: var(--line-2, #f8fafc);
}

.news-link {
    flex: 1 1 220px;
    color: var(--ink, #222);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
}

.news-link:hover {
    color: var(--accent, #222);
    text-decoration: underline;
}

.news-source {
    flex: 0 0 auto;
    color: var(--muted, #888);
    font-size: 0.8rem;
    white-space: nowrap;
}

/* ── 동영상 / 이미지 그리드 ── */
.media-container {
    display: grid;
    gap: 12px;
}

.videos-container {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.images-container {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.media-item {
    margin: 0;
    border-radius: var(--radius-sm, 8px);
    overflow: hidden;
    border: 1px solid var(--line, #e5e7eb);
    background: var(--surface, #fff);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.06));
}

.media-link {
    display: block;
    line-height: 0;
    text-decoration: none;
}

.media-thumbnail,
.media-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    vertical-align: middle;
    transition: filter 0.2s ease;
}

.image-item .media-image {
    aspect-ratio: 1 / 1;
}

.media-link:hover .media-thumbnail,
.media-link:hover .media-image {
    filter: brightness(1.05);
}

.video-item {
    position: relative;
}

.video-item .media-link::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    margin: -10px 0 0 -6px;
    border-style: solid;
    border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent rgba(255, 255, 255, 0.92);
    pointer-events: none;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
}

@media (max-width: 640px) {
    .news-item {
        flex-direction: column;
        gap: 4px;
        padding: 12px 14px;
    }

    .news-source {
        white-space: normal;
    }

    .videos-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .images-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== board article content (CMS / WordPress classes) ========== */
/* 颜色全部走 _themes.php → link_render_theme_style() 注入的 :root 变量 */

.board-article-body .content-wrap,
.board-article-body .post-content,
.home-guide-body .content-wrap,
.home-guide-body .post-content {
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

.board-article-body .post-content > *:first-child,
.home-guide-body .post-content > *:first-child {
    margin-top: 0;
}

.board-article-body .post-content > *:last-child,
.home-guide-body .post-content > *:last-child {
    margin-bottom: 0;
}

/* 图片：aligncenter / size-full / wp-image-* */
.board-article-body .aligncenter,
.home-guide-body .aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.board-article-body .size-full,
.home-guide-body .size-full {
    width: 100%;
    max-width: 100%;
    height: auto;
}

.board-article-body img[class*="wp-image-"],
.home-guide-body img[class*="wp-image-"],
.board-article-body .post-content img,
.home-guide-body .post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid var(--line-2, #f1f5f9);
}

.board-article-body .aligncenter img,
.home-guide-body .aligncenter img {
    margin: 0 auto;
}

/* 按钮：custom-button / custom-button2 … */
.board-article-body [class*="custom-button"],
.home-guide-body [class*="custom-button"] {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 10px 0;
    padding: 14px 28px;
    background: var(--gradient-accent, var(--accent));
    color: var(--on-accent, #ffffff) !important;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.4;
    text-align: center;
    text-decoration: none !important;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(var(--shadow-rgb), 0.25);
    transition: filter var(--ease, 0.2s ease);
}

.board-article-body [class*="custom-button"]:hover,
.home-guide-body [class*="custom-button"]:hover {
    filter: brightness(1.08);
    color: var(--on-accent, #ffffff) !important;
}

/* 提示框 */
.board-article-body .tip-box,
.home-guide-body .tip-box {
    background: linear-gradient(135deg, var(--accent-soft) 0%, var(--tag-bg) 100%);
    padding: 16px 18px;
    border-radius: var(--radius-sm, 8px);
    margin: 16px 0;
    border: 1px solid var(--tag-border);
    color: var(--muted, #475569);
    font-size: 0.94rem;
    line-height: 1.75;
}

.board-article-body .tip-box p:last-child,
.home-guide-body .tip-box p:last-child {
    margin-bottom: 0;
}

.board-article-body .tip-box strong,
.home-guide-body .tip-box strong {
    color: var(--tag-color);
}

/* 核心摘要 summary */
.board-article-body .summary,
.home-guide-body .summary,
.main-content .summary,
.summary {
    background: linear-gradient(135deg, var(--accent-soft) 0%, var(--tag-bg) 100%);
    padding: 16px 18px;
    border-radius: var(--radius-sm, 8px);
    margin: 16px 0;
    border: 1px solid var(--tag-border);
    border-left: 4px solid var(--accent);
    color: var(--muted, #475569);
    font-size: 0.94rem;
    line-height: 1.75;
}

.board-article-body .summary ul,
.home-guide-body .summary ul,
.main-content .summary ul,
.summary ul {
    margin: 0;
    padding: 0 0 0 1.15em;
    list-style: disc;
}

.board-article-body .summary li,
.home-guide-body .summary li,
.main-content .summary li,
.summary li {
    margin: 0 0 0.55em;
}

.board-article-body .summary li:last-child,
.home-guide-body .summary li:last-child,
.main-content .summary li:last-child,
.summary li:last-child {
    margin-bottom: 0;
}

.board-article-body .summary strong,
.home-guide-body .summary strong,
.main-content .summary strong,
.summary strong {
    color: var(--tag-color);
    font-weight: 700;
}

.board-article-body .summary p:last-child,
.home-guide-body .summary p:last-child,
.main-content .summary p:last-child,
.summary p:last-child {
    margin-bottom: 0;
}

/* 警告框（主色用主题 accent 系） */
.board-article-body .warning,
.home-guide-body .warning {
    background: var(--tag-bg);
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius-sm, 8px) var(--radius-sm, 8px) 0;
    padding: 14px 16px;
    margin: 16px 0;
    color: var(--tag-color);
    font-size: 0.94rem;
    line-height: 1.75;
}

.board-article-body .warning strong,
.home-guide-body .warning strong {
    color: var(--accent-deep);
}

/* 表格 */
.board-article-body .table-wrap,
.home-guide-body .table-wrap {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid var(--line, #e2e8f0);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.06));
    -webkit-overflow-scrolling: touch;
}

.board-article-body .table-wrap table,
.home-guide-body .table-wrap table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    background: var(--surface, #fff);
    font-size: 0.9rem;
}

.board-article-body .table-wrap th,
.home-guide-body .table-wrap th {
    background: var(--gradient-accent, var(--accent));
    color: var(--on-accent, #ffffff);
    padding: 12px 16px;
    text-align: left;
    font-weight: 700;
    white-space: nowrap;
}

.board-article-body .table-wrap td,
.home-guide-body .table-wrap td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--line, #e2e8f0);
    color: var(--muted, #475569);
    vertical-align: top;
}

.board-article-body .table-wrap tr:last-child td,
.home-guide-body .table-wrap tr:last-child td {
    border-bottom: 0;
}

.board-article-body .table-wrap tr:nth-child(even) td,
.home-guide-body .table-wrap tr:nth-child(even) td {
    background: var(--line-2, #f1f5f9);
}

/* FAQ */
.board-article-body .faq-section,
.home-guide-body .faq-section {
    margin: 28px 0 8px;
    padding-top: 8px;
}

.board-article-body .faq-section > h2,
.home-guide-body .faq-section > h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--ink, #0f172a);
    text-align: center;
    margin: 0 0 20px;
    letter-spacing: -0.02em;
}

.board-article-body .faq-section > h2::after,
.home-guide-body .faq-section > h2::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    background: var(--accent);
    margin: 12px auto 0;
    border-radius: 2px;
}

.board-article-body .faq-question,
.home-guide-body .faq-question {
    display: block;
    width: 100%;
    margin: 0;
    padding: 16px 18px;
    background: var(--accent-soft);
    border: 1px solid var(--line, #e2e8f0);
    border-radius: var(--radius-sm, 8px) var(--radius-sm, 8px) 0 0;
    color: var(--accent-deep);
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.55;
    text-align: left;
}

.board-article-body .faq-answer,
.home-guide-body .faq-answer {
    padding: 14px 18px 16px;
    margin: 0 0 12px;
    background: var(--surface, #fff);
    border: 1px solid var(--line, #e2e8f0);
    border-top: 0;
    border-radius: 0 0 var(--radius-sm, 8px) var(--radius-sm, 8px);
    color: var(--muted, #475569);
    font-size: 0.94rem;
    line-height: 1.75;
}

.board-article-body .faq-answer:last-child,
.home-guide-body .faq-answer:last-child {
    margin-bottom: 0;
}

.board-article-body .faq-answer p:last-child,
.home-guide-body .faq-answer p:last-child {
    margin-bottom: 0;
}

.board-article-body .faq-question + .faq-answer,
.home-guide-body .faq-question + .faq-answer {
    margin-top: -1px;
}

/* 链接按钮 cb-random */
.board-article-body a.cb-random,
.home-guide-body a.cb-random {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 10px 0;
    padding: 14px 28px;
    background: var(--gradient-accent, var(--accent));
    color: var(--on-accent, #ffffff) !important;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.4;
    text-align: center;
    text-decoration: none !important;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(var(--shadow-rgb), 0.25);
    transition: filter var(--ease, 0.2s ease);
}

.board-article-body a.cb-random:hover,
.home-guide-body a.cb-random:hover {
    filter: brightness(1.08);
    color: var(--on-accent, #ffffff) !important;
}

.board-article-body a.cb-random strong,
.home-guide-body a.cb-random strong {
    color: inherit;
    font-weight: inherit;
}

@media (max-width: 640px) {
    .board-article-body [class*="custom-button"],
    .home-guide-body [class*="custom-button"],
    .board-article-body a.cb-random,
    .home-guide-body a.cb-random {
        padding: 13px 20px;
    }

    .board-article-body .table-wrap table,
    .home-guide-body .table-wrap table {
        min-width: 360px;
        font-size: 0.85rem;
    }

    .board-article-body .faq-question,
    .home-guide-body .faq-question,
    .board-article-body .faq-answer,
    .home-guide-body .faq-answer {
        padding-left: 14px;
        padding-right: 14px;
    }
}
