@charset "UTF-8";

/* ===== UI Utilities ===== */
/* Extracted from the former shared utility layer */

/* ===== Notification ===== */
.ulive-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: #fff;
    padding: 15px 25px;
    border-radius: 4px;
    box-shadow: var(--shadow-md);
    z-index: 10000;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    font-weight: 500;
}

.ulive-notification.show {
    transform: translateX(0);
}

/* ===== Sticky Header ===== */
.site-header.sticky {
    box-shadow: none;
}

/* ===== Posts Grid ===== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.post-card {
    background-color: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.post-card:hover {
    box-shadow: var(--shadow-md);
}

.post-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-content {
    padding: 20px;
}

.post-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.post-title a {
    color: var(--text-dark);
}

.post-title a:hover {
    color: var(--primary-color);
}

.post-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.post-excerpt {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ===== No Results ===== */
.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.no-results p {
    color: var(--text-light);
}

/* ===== Pagination Nav ===== */
.pagination-nav {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.pagination-nav ul {
    display: flex;
    gap: 8px;
    list-style: none;
}

.pagination-nav a,
.pagination-nav span {
    display: block;
    padding: 10px 16px;
    border: 2px solid var(--border-light);
    border-radius: 4px;
    color: var(--text-medium);
    font-weight: 500;
}

.pagination-nav a:hover,
.pagination-nav .current {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* ===== Mobile Menu Open State ===== */
body.menu-open {
    overflow: hidden;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Frontend Confirm ===== */
/* 前台確認彈層 */
.ulive-confirm {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}
.ulive-confirm[hidden] {
    display: none !important;
}
.ulive-confirm.is-open {
    display: flex !important;
}
.ulive-confirm__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}
.ulive-confirm__dialog {
    position: relative;
    width: 100%;
    max-width: 360px;
    padding: 28px 24px 22px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    text-align: center;
}
.ulive-confirm__message {
    margin: 0 0 24px;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
}
.ulive-confirm__actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}
.ulive-confirm__btn {
    min-width: 108px;
    min-height: 42px;
    padding: 0 20px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.ulive-confirm__btn--cancel {
    background: #fff;
    color: #666;
    border: 1px solid #d8dde6;
}
.ulive-confirm__btn--cancel:hover {
    border-color: #3fa7f3;
    color: #3fa7f3;
}
.ulive-confirm__btn--ok {
    background: #3fa7f3;
    color: #fff;
}
.ulive-confirm__btn--ok:hover {
    background: #2f96e0;
}
body.ulive-confirm-open {
    overflow: hidden;
}

/* ===== Back To Top ===== */
/* ============================================================
   Back to Top 按钮（右下角浮动，滚动 > 300px 显示）
   ============================================================ */
.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 80px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity .3s ease, transform .3s ease, background .2s ease, box-shadow .2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.back-to-top .back-to-top-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: normal;
    line-height: 1;
    color: #4A90E2;
}
.back-to-top .back-to-top-icon:before {
    font-family: "fontello" !important;
    font-weight: normal !important;
}
.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.back-to-top:hover {
    background: #f0f7ff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
.back-to-top:focus {
    outline: none;
}

@media (max-width: 768px) {
    .back-to-top {
        right: max(12px, env(safe-area-inset-right, 0px));
        bottom: max(72px, calc(72px + env(safe-area-inset-bottom, 0px)));
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    /* Notification smaller on small screens */
    .ulive-notification {
        top: auto;
        bottom: 80px;
        right: 10px;
        left: 10px;
        text-align: center;
        transform: translateY(120%);
    }

    .ulive-notification.show {
        transform: translateY(0);
    }
}
