/* ==========================================================================
   Layout - Page structure, navbar, banners, footer, background decorations
   ========================================================================== */

/* --- Font Face --- */
@font-face {
    font-family: AlimamaShuHeiTi;
    src: url("/AlimamaShuHeiTi-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* --- Body Background --- */
body::before {
    content: "";
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(circle at 15% 20%, color(xyz-d65 0.264 0.326 0.77 / 0.059), rgba(0, 0, 0, 0) 50%),
        radial-gradient(circle at 85% 80%, color(xyz-d65 0.264 0.326 0.77 / 0.039), rgba(0, 0, 0, 0) 50%),
        radial-gradient(circle, rgba(161, 112, 235, 0.03), rgba(0, 0, 0, 0) 60%);
    position: fixed;
    inset: 0;
}

/* --- Background Decoration Blobs --- */
.bg-decoration {
    pointer-events: none;
    z-index: 0;
    position: fixed;
}

.bg-decoration-1 {
    background: radial-gradient(circle, color(xyz-d65 0.264 0.326 0.77 / 0.051), rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    width: 300px;
    height: 300px;
    top: 10%;
    right: -5%;
}

.bg-decoration-2 {
    background: radial-gradient(circle, rgba(161, 112, 235, 0.04), rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    width: 400px;
    height: 400px;
    bottom: 15%;
    left: -8%;
}

.bg-decoration-3 {
    background: radial-gradient(circle, color(xyz-d65 0.144 0.232 0.276 / 0.031), rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    width: 600px;
    height: 600px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* --- Navbar --- */
.navbar-header {
    background: linear-gradient(135deg, rgb(30, 111, 217), rgb(45, 140, 240), rgb(30, 111, 217));
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: rgba(30, 111, 217, 0.3) 0px 2px 8px;
}

.navbar-action-btn {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: background 0.2s, border-color 0.2s;
}

.navbar-action-btn:hover {
    color: rgb(255, 255, 255);
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.35);
}

.navbar-action-btn > button {
    color: rgba(255, 255, 255, 0.9) !important;
    background: 0px 0px !important;
}

.navbar-action-btn > button:hover {
    color: rgb(255, 255, 255) !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

.navbar-toggle-btn {
    white-space: nowrap;
    align-items: center;
    gap: 0.375rem;
    height: 2rem;
    padding: 0px 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    color: rgba(255, 255, 255, 0.9) !important;
    background: 0px 0px !important;
}

.navbar-toggle-btn:hover {
    color: rgb(255, 255, 255) !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

/* --- Main Content --- */
.main-content {
    /* base styles from Tailwind classes on element */
}

.main-layout-content {
    /* base styles from Tailwind classes on element */
}

/* --- Ad Banner --- */
.ad-banner {
    border-radius: 0.5rem;
    transition: box-shadow 0.2s, transform 0.2s;
    display: block;
    overflow: hidden;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 8px;
}

.ad-banner:hover {
    transform: translateY(-1px);
    box-shadow: rgba(0, 0, 0, 0.15) 0px 4px 16px;
}

.ad-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Friend Links --- */
.friend-links-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.friend-links-card::before {
    content: "";
    background: linear-gradient(90deg, rgb(244, 95, 176), rgb(246, 61, 112), rgb(244, 95, 176)) 0px 0px / 200% 100%;
    height: 3px;
    animation: 4s ease 0s infinite normal none running gradientShift;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.friend-link-item {
    border-radius: calc(var(--radius) - 2px);
    background: var(--muted);
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0);
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
    display: flex;
}

.friend-link-item:hover {
    background: var(--accent);
    border-color: var(--border);
    transform: translateY(-1px);
    box-shadow: oklch(0.68 0.15 230 / 0.1) 0px 2px 8px;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: 0px 0px;
}

::-webkit-scrollbar-thumb {
    background: oklch(0.68 0.15 230 / 0.25);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: oklch(0.68 0.15 230 / 0.4);
}

/* --- Update Notification --- */
.update-notification {
    z-index: 50;
    background: var(--card);
    border: 1px solid var(--border);
    pointer-events: auto;
    white-space: nowrap;
    border-radius: 0.5rem;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.35s;
    display: flex;
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translate(-50%);
    box-shadow: rgba(0, 0, 0, 0.12) 0px 4px 16px, rgba(0, 0, 0, 0.08) 0px 1px 4px;
}

.update-notification-show {
    opacity: 1;
    animation: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0s 1 normal none running notif-slide-in;
    transform: translate(-50%) translateY(0px);
}

.update-notification-hide {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%) translateY(-1rem);
}

@keyframes notif-slide-in {
    0% {
        opacity: 0;
        transform: translate(-50%) translateY(-1.5rem);
    }
    100% {
        opacity: 1;
        transform: translate(-50%) translateY(0px);
    }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* --- PC Mode: Layout Overrides --- */
body.device-pc .main-content {
    max-width: 72rem;
    font-size: 1rem;
}

body.device-pc .navbar-inner,
body.device-pc .ad-banner-wrapper {
    max-width: 72rem;
}

body.device-pc .friend-links-wrapper {
    max-width: 72rem;
}
