:root {
    --bg-color: #ffffff;
    --text-main: #1e293b;
    --text-dim: #94a3b8;
    --spotlight-color: rgba(0, 0, 0, 0.04);
    --accent-purple: #9b5de5;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Outfit', sans-serif;
    --card-bg: #ffffff;
    --card-border: rgba(0, 0, 0, 0.06);
    --modal-bg: #ffffff;
    --modal-overlay: rgba(0, 0, 0, 0.55);
    --footer-border: rgba(0, 0, 0, 0.05);
    --ambient-color-1: rgba(155, 93, 229, 0.15);
    --ambient-color-2: rgba(139, 92, 246, 0.12);
}

/* ========================================
   AMBIENT LIGHT CANVAS (Living Background)
   ======================================== */
#ambientCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

[data-theme="dark"] #ambientCanvas {
    opacity: 0.4;
}

/* ========================================
   STARRY SKY CANVAS (Dark Mode Only)
   ======================================== */
#starryCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    /* Above body bg, behind content */
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.5s ease;
}

[data-theme="dark"] #starryCanvas {
    opacity: 1;
}

/* ========================================
   BREATHING CARDS ANIMATION
   ======================================== */
@keyframes breathe {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-4px);
    }
}

/* Breathing only activates AFTER entrance animation completes */
.prompt-card.breathing {
    animation: breathe 4s ease-in-out infinite;
    animation-delay: var(--breathe-delay, 0s);
}

/* Disable breathing on hover to prevent jank */
.prompt-card.breathing:hover {
    animation-play-state: paused;
}

/* Disable breathing during filtering to allow FLIP animations */
.prompt-card.filtering {
    animation: none !important;
    transition: none !important;
}

/* FLIP moving cards - smooth position transition */
.prompt-card.filtering.filter-moving {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* New cards entering - smooth fade + scale */
.prompt-card.filtering.filter-entering {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease-out !important;
}

/* Cards fading out before layout change */
.prompt-card.filter-fading-out {
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.18s ease-out, transform 0.18s ease-out;
    animation: none;
    pointer-events: none;
}

/* ========================================
   WAVE SCROLL REVEAL ANIMATION
   ======================================== */
.prompt-card.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.prompt-card.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Dark Mode Colors */
[data-theme="dark"] {
    --bg-color: #0f172a;
    --text-main: #f1f5f9;
    --text-dim: #64748b;
    --spotlight-color: rgba(255, 255, 255, 0.03);
    --card-bg: #1e293b;
    --card-border: rgba(255, 255, 255, 0.08);
    --modal-bg: #1e293b;
    --modal-overlay: rgba(0, 0, 0, 0.65);
    --footer-border: rgba(255, 255, 255, 0.05);
    --accent-starry: #6b9ece;
    /* Starry blue for dark mode accents */
}

/* Dark mode: remove card borders, update modal */
[data-theme="dark"] .prompt-card {
    border-color: transparent;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .modal-inner {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .modal-meta span {
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: var(--text-dim);
}

[data-theme="dark"] .modal-image-col {
    background: #222d3d;
}

[data-theme="dark"] .prompt-area {
    background: #222d3d;
    border-color: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .copy-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-dim);
}

[data-theme="dark"] .modal-img-counter {
    background: rgba(0, 0, 0, 0.6);
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Smooth theme transition */
body,
.prompt-card,
.poetry-modal,
.modal-inner,
.prompt-area,
.disclaimer-footer {
    transition: background-color 0.5s ease, border-color 0.5s ease, color 0.5s ease;
}

/* ========================================
   USER AVATAR MENU (Glassmorphism)
   ======================================== */
.user-avatar-container {
    position: fixed;
    top: 28px;
    right: 30px;
    z-index: 100;
    cursor: pointer;
}

.user-avatar-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
    color: var(--text-dim);
    font-size: 1rem;
}

.user-avatar-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    color: var(--text-main);
}

.user-avatar-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Glassmorphism Dropdown */
.avatar-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 220px;
    background: rgba(255, 255, 255, 0.70);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.avatar-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

[data-theme="dark"] .avatar-dropdown {
    background: rgba(30, 41, 59, 0.65);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Dropdown Header - Nickname + Theme Toggle */
.dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--card-border);
}

.identity-name {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.identity-name .admin-badge {
    font-size: 0.8rem;
}

/* Theme Toggle Button - Elegant Icon */
.theme-toggle-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(155, 93, 229, 0.2);
    border-color: rgba(155, 93, 229, 0.4);
}

[data-theme="dark"] .theme-toggle-btn:hover {
    box-shadow: 0 4px 12px rgba(93, 159, 216, 0.25);
    border-color: rgba(93, 159, 216, 0.5);
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

.theme-icon {
    position: absolute;
    font-size: 1.1rem;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

/* Light mode: show sun, hide moon */
.sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.moon-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

/* Dark mode: hide sun, show moon */
[data-theme="dark"] .sun-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

[data-theme="dark"] .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Subtle glow effect on toggle */
.theme-toggle-btn::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

[data-theme="dark"] .theme-toggle-btn::after {
    background: radial-gradient(circle, rgba(93, 159, 216, 0.35) 0%, transparent 70%);
}

.theme-toggle-btn:hover::after {
    opacity: 1;
}

/* Legacy styles kept for compatibility */
.dropdown-identity {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--card-border);
}

/* Dropdown Sections - keeping for other potential uses */
.dropdown-section {
    padding: 12px 0;
    border-bottom: 1px solid var(--card-border);
}

.section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    display: block;
    margin-bottom: 10px;
}

/* Legacy Capsule Theme Switch - keeping for compatibility */
.capsule-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 30px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 4px;
}

.capsule-switch:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.capsule-icon {
    font-size: 1rem;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.capsule-icon.sun {
    background: rgba(245, 158, 11, 0.2);
}

.capsule-icon.moon {
    background: transparent;
}

[data-theme="dark"] .capsule-icon.sun {
    background: transparent;
}

[data-theme="dark"] .capsule-icon.moon {
    background: rgba(93, 159, 216, 0.25);
}

.capsule-slider {
    display: none;
    /* Using highlight on icons instead */
}

/* Dropdown Actions */
.dropdown-actions {
    padding-top: 12px;
}

.dropdown-action {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-main);
    font-size: 0.9rem;
    font-family: var(--font-sans);
    transition: all 0.2s ease;
    text-align: left;
}

.dropdown-action:hover {
    background: rgba(155, 93, 229, 0.1);
    color: var(--accent-purple);
}

[data-theme="dark"] .dropdown-action:hover {
    background: rgba(93, 159, 216, 0.12);
    color: #5d9fd8;
}

[data-theme="dark"] .dropdown-action:hover i {
    color: #5d9fd8;
}

.dropdown-action i {
    width: 20px;
    text-align: center;
    color: var(--text-dim);
    transition: color 0.2s ease;
}

.dropdown-action:hover i {
    color: var(--accent-purple);
}

/* Back button dark mode */
[data-theme="dark"] .back-btn {
    color: rgba(255, 255, 255, 0.5) !important;
}

[data-theme="dark"] .back-btn:hover {
    color: white !important;
}

/* Back button interactive effects */
.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.back-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: translateX(-3px);
}

[data-theme="dark"] .back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    margin: 0;
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- Spotlight Navigation --- */
.poetry-nav-container {
    position: relative;
    z-index: 10;
    /* Ensure search dropdown can appear above featured-banner */
    padding: 8vh 5vw 4vh;
    /* Reduced bottom padding */
    text-align: center;
    cursor: default;
    /* Note: mask-image removed - it was clipping the search dropdown */
}

/* ===== System Announcement - Multi-Type Support ===== */

/* Base Banner Type (Default) */
.announcement-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.95rem;
    position: relative;
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    animation: bannerSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.announcement-banner.closing {
    animation: bannerSlideOut 0.3s ease-in forwards;
}

@keyframes bannerSlideIn {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }

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

@keyframes bannerSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-100%);
    }
}

/* Modal Type (Center Popup) */
.announcement-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalOverlayIn 0.3s ease-out;
}

.announcement-modal-overlay.closing {
    animation: modalOverlayOut 0.3s ease-in forwards;
}

@keyframes modalOverlayIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalOverlayOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.announcement-modal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0;
    border-radius: 24px;
    max-width: 480px;
    width: 90%;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: modalPopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.announcement-modal-overlay.closing .announcement-modal {
    animation: modalPopOut 0.25s ease-in forwards;
}

@keyframes modalPopIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }

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

@keyframes modalPopOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Header Section - Icon + Title centered */
.announcement-modal .announcement-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 24px 12px;
}

.announcement-modal .announcement-icon-wrapper {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.announcement-modal .announcement-title {
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.9;
}

.announcement-modal .announcement-title {
    font-size: 1.1rem;
    font-weight: 600;
    opacity: 0.9;
    letter-spacing: 0.5px;
}

/* Body Section */
.announcement-modal .announcement-body {
    padding: 0 24px 24px;
}

.announcement-modal .announcement-text {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    font-size: 0.95rem;
    line-height: 1.7;
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
}

/* Footer Section */
.announcement-modal .announcement-footer {
    padding: 0 24px 24px;
    display: flex;
    justify-content: center;
}

.announcement-modal .announcement-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0.7;
}

.announcement-modal .announcement-close:hover {
    background: rgba(255, 255, 255, 0.25);
    opacity: 1;
    transform: scale(1.1);
}

/* "我知道了" Acknowledge Button - Modal */
.announcement-ack-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.announcement-ack-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
}

.announcement-ack-btn i {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* "我知道了" Acknowledge Button - Toast (smaller) */
.announcement-ack-btn-sm {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
    white-space: nowrap;
}

.announcement-ack-btn-sm:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Toast Type (Bottom Right) */
.announcement-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    max-width: 420px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    z-index: 9998;
    animation: toastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.announcement-toast.closing {
    animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

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

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.announcement-toast .announcement-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.announcement-toast .announcement-content i {
    font-size: 1.2rem;
    margin-top: 2px;
}

.announcement-toast .announcement-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.announcement-toast .announcement-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Banner Common Elements */
.announcement-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.announcement-content i {
    font-size: 1.1rem;
}

.announcement-banner .announcement-close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.announcement-banner .announcement-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

/* ===== Color Themes ===== */

/* Purple (Default) */
.announcement-color-purple,
.announcement-banner.color-purple,
.announcement-modal.color-purple,
.announcement-toast.color-purple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

/* Blue */
.announcement-color-blue,
.announcement-banner.color-blue,
.announcement-modal.color-blue,
.announcement-toast.color-blue {
    background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%);
    box-shadow: 0 4px 20px rgba(33, 147, 176, 0.3);
}

/* Green */
.announcement-color-green,
.announcement-banner.color-green,
.announcement-modal.color-green,
.announcement-toast.color-green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    box-shadow: 0 4px 20px rgba(17, 153, 142, 0.3);
}

/* Orange */
.announcement-color-orange,
.announcement-banner.color-orange,
.announcement-modal.color-orange,
.announcement-toast.color-orange {
    background: linear-gradient(135deg, #f2994a 0%, #f2c94c 100%);
    box-shadow: 0 4px 20px rgba(242, 153, 74, 0.3);
}

/* Red */
.announcement-color-red,
.announcement-banner.color-red,
.announcement-modal.color-red,
.announcement-toast.color-red {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    box-shadow: 0 4px 20px rgba(235, 51, 73, 0.3);
}

/* Dark */
.announcement-color-dark,
.announcement-banner.color-dark,
.announcement-modal.color-dark,
.announcement-toast.color-dark {
    background: linear-gradient(135deg, #2c3e50 0%, #4a5568 100%);
    box-shadow: 0 4px 20px rgba(44, 62, 80, 0.3);
}

/* Dark mode adjustments */
[data-theme="dark"] .announcement-banner {
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .announcement-modal {
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .announcement-toast {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* ===== Font Size Classes ===== */
.announcement-banner.size-small,
.announcement-modal.size-small,
.announcement-toast.size-small {
    font-size: 0.85rem;
}

.announcement-banner.size-medium,
.announcement-modal.size-medium,
.announcement-toast.size-medium {
    font-size: 0.95rem;
}

.announcement-banner.size-large,
.announcement-modal.size-large,
.announcement-toast.size-large {
    font-size: 1.1rem;
}

/* Text with line breaks */
#announcementText,
.announcement-text,
.announcement-toast span {
    white-space: pre-wrap;
    word-break: break-word;
}

/* The spotlight effect overlay - Darker trace on white */
.spotlight-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 150%;
    /* Extend taller */
    pointer-events: none;
    background: radial-gradient(800px circle at var(--cursor-x, 50%) var(--cursor-y, 50%),
            rgba(0, 0, 0, 0.03),
            /* Subtle shadow trace */
            transparent 50%);
    z-index: -1;
    /* Behind text */
    opacity: 0;
    transition: opacity 0.5s ease;
}

.poetry-nav-container:hover .spotlight-overlay {
    opacity: 1;
}

/* Pinterest-style Search Bar */
.nav-search-wrapper {
    position: relative;
    max-width: 400px;
    margin: 0 auto 24px;
    z-index: 100;
    /* High z-index to stay above featured banner */
}

.nav-search {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 12px 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.6s ease, box-shadow 0.6s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    /* Softer shadow */
    --mood-color: rgba(139, 92, 246, 0.5);
    /* Default mood color */
}

.nav-search:focus-within {
    border-color: color-mix(in srgb, var(--mood-color) 60%, transparent);
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--mood-color) 30%, transparent),
        0 0 20px color-mix(in srgb, var(--mood-color) 15%, transparent),
        0 0 40px color-mix(in srgb, var(--mood-color) 8%, transparent);
    transform: scale(1.01);
}

/* Mood lighting breathing animation - subtle pulse */
@keyframes moodBreathing {

    0%,
    100% {
        box-shadow:
            0 0 0 1px color-mix(in srgb, var(--mood-color) 25%, transparent),
            0 0 15px color-mix(in srgb, var(--mood-color) 10%, transparent);
    }

    50% {
        box-shadow:
            0 0 0 1px color-mix(in srgb, var(--mood-color) 35%, transparent),
            0 0 25px color-mix(in srgb, var(--mood-color) 18%, transparent);
    }
}

.nav-search.mood-active:focus-within {
    animation: moodBreathing 3s ease-in-out infinite;
}

/* Dark mode: use starry blue instead of purple for search focus */
[data-theme="dark"] .nav-search {
    --mood-color: rgba(93, 159, 216, 0.5);
    background: rgba(20, 30, 50, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .nav-search:focus-within {
    border-color: rgba(93, 159, 216, 0.45);
    box-shadow:
        0 0 0 1px rgba(93, 159, 216, 0.25),
        0 0 20px rgba(93, 159, 216, 0.12),
        0 0 40px rgba(93, 159, 216, 0.06);
}

.nav-search i {
    color: var(--text-dim);
    font-size: 0.95rem;
}

.nav-search input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 1rem;
    color: var(--text-main);
    font-family: var(--font-sans);
}

.nav-search input::placeholder {
    color: var(--text-dim);
    opacity: 0.7;
}

/* Search Dropdown (Glassmorphism) */
.search-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    /* Increased spacing slightly */
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.70);
    /* More transparent */
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    /* Glass border */
    border-radius: 20px;
    /* Rounder corners */
    padding: 20px;
    box-shadow:
        0 20px 50px -10px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    /* Inner light frame */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    /* Slight scale for elegance */
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-origin: top center;
}

.search-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

[data-theme="dark"] .search-dropdown {
    background: rgba(15, 23, 42, 0.65);
    /* Elegant dark glass */
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 20px 50px -10px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.dropdown-section-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 16px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.8;
}

/* Hot Tags - 简洁药丸状标签 */
.hot-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 4px 0;
}

.hot-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-main);
    cursor: pointer;
    white-space: nowrap;
    opacity: 1;
    transition: all 0.2s ease;
}

/* 入场动画 + 微微呼吸 */
.search-dropdown.active .hot-tag {
    animation:
        tagFadeIn 0.3s ease forwards,
        subtleBreath 4s ease-in-out 0.5s infinite;
    opacity: 0;
}

/* 错开入场和呼吸时间 */
.search-dropdown.active .hot-tag:nth-child(1) {
    animation-delay: 0s, 0.5s;
}

.search-dropdown.active .hot-tag:nth-child(2) {
    animation-delay: 0.03s, 0.8s;
}

.search-dropdown.active .hot-tag:nth-child(3) {
    animation-delay: 0.06s, 1.1s;
}

.search-dropdown.active .hot-tag:nth-child(4) {
    animation-delay: 0.09s, 1.4s;
}

.search-dropdown.active .hot-tag:nth-child(5) {
    animation-delay: 0.12s, 1.7s;
}

.search-dropdown.active .hot-tag:nth-child(6) {
    animation-delay: 0.15s, 2.0s;
}

@keyframes tagFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

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

@keyframes subtleBreath {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
    }
}

/* 悬停效果 */
.hot-tag:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
    color: var(--accent-purple);
}

/* 暗色主题 */
[data-theme="dark"] .hot-tag {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .hot-tag:hover {
    background: rgba(93, 159, 216, 0.15);
    border-color: rgba(93, 159, 216, 0.35);
    color: #5d9fd8;
}

/* Autocomplete Suggestions */
.search-suggestions {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: var(--font-sans);
}

.suggestion-item i {
    color: var(--text-dim);
    font-size: 0.9rem;
    opacity: 0.6;
}

.suggestion-item:hover,
.suggestion-item.keyboard-active {
    background: rgba(139, 92, 246, 0.08);
}

.suggestion-item:hover i {
    color: var(--accent-purple);
    opacity: 0.8;
}

.suggestion-item.keyboard-active {
    background: rgba(139, 92, 246, 0.12);
}

[data-theme="dark"] .suggestion-item:hover,
[data-theme="dark"] .suggestion-item.keyboard-active {
    background: rgba(93, 159, 216, 0.12);
}

[data-theme="dark"] .suggestion-item:hover i {
    color: #5d9fd8;
}

/* Inline Hot Tags (subtle hints at bottom of suggestions) */
.inline-hot-tags {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    margin-top: 0;
    /* Small compensation for border-radius visual effect */
    margin-bottom: -3px;
}

/* When there are suggestions above, adjust spacing to center between divider and bottom */
.inline-hot-tags.with-suggestions {
    border-top: 1px solid var(--card-border);
    margin-top: 6px;
    padding-top: 10px;
    padding-bottom: 6px;
    /* Extend more into dropdown's bottom padding (20px) + compensate for border-radius visual effect */
    margin-bottom: -16px;
}

.inline-label {
    font-size: 0.75rem;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.5;
    flex-shrink: 0;
}

.inline-hot-tags-list {
    display: flex;
    gap: 8px;
}

.inline-hot-tag {
    padding: 5px 12px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
}

/* Light mode: purple hover */
.inline-hot-tag:hover {
    background: rgba(155, 93, 229, 0.1);
    border-color: rgba(155, 93, 229, 0.3);
    color: var(--accent-purple);
    opacity: 1;
}

/* Dark mode styles */
[data-theme="dark"] .inline-hot-tag {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Dark mode: blue hover */
[data-theme="dark"] .inline-hot-tag:hover {
    background: rgba(93, 159, 216, 0.15);
    border-color: rgba(93, 159, 216, 0.3);
    color: #5d9fd8;
}

/* Favorites Tab Styling */
.nav-item.favorites-tab i {
    color: #ff4757;
    margin-right: 4px;
}

.nav-items {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem 2.5rem;
    font-family: var(--font-serif);
    font-size: 1.2rem;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.nav-items.loaded {
    opacity: 1;
}

/* Back navigation style */
.nav-item.back-nav {
    color: var(--text-dim);
    opacity: 0.7;
}

.nav-item.back-nav:hover {
    opacity: 1;
    transform: translateX(-3px);
}

/* Sub-tag navigation style */
.nav-item.sub-tag {
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}

/* ========================================
   SEASONAL TAG STYLING
   ======================================== */
.nav-item.seasonal-tag {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(255, 193, 7, 0.15));
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 20px;
    padding: 8px 16px;
    margin: -8px 0;
    position: relative;
    animation: seasonalPulse 3s ease-in-out infinite;
}

.nav-item.seasonal-tag .en {
    font-size: 1.2rem;
}

.nav-item.seasonal-tag .cn small {
    font-size: 0.65rem;
    opacity: 0.8;
    margin-left: 4px;
    color: #ff6b6b;
}

.nav-item.seasonal-tag:hover {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.25), rgba(255, 193, 7, 0.25));
    border-color: rgba(255, 107, 107, 0.5);
    transform: translateY(-3px) scale(1.02);
}

.nav-item.seasonal-tag.active {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.3), rgba(255, 193, 7, 0.3));
    border-color: rgba(255, 107, 107, 0.6);
}

@keyframes seasonalPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0);
    }

    50% {
        box-shadow: 0 0 15px 2px rgba(255, 107, 107, 0.2);
    }
}

/* Dark mode seasonal tag */
[data-theme="dark"] .nav-item.seasonal-tag {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(255, 193, 7, 0.1));
    border-color: rgba(255, 107, 107, 0.25);
}

[data-theme="dark"] .nav-item.seasonal-tag:hover {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.2), rgba(255, 193, 7, 0.2));
}

@keyframes navTagFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.nav-item.sub-tag {
    animation-name: navTagFadeIn;
}

/* ========================================
   FEATURED BANNER
   ======================================== */
.featured-banner {
    position: relative;
    max-width: 1400px;
    margin: 0 auto 40px;
    padding: 0 5vw;
    height: 280px;
    display: flex;
    align-items: center;
    overflow: hidden;
    /* opacity controlled by JS */
}

.featured-image-container {
    position: absolute;
    top: 0;
    left: 5vw;
    right: 5vw;
    height: 100%;
    border-radius: 24px;
    overflow: hidden;
}

.featured-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.featured-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right,
            rgba(0, 0, 0, 0.7) 0%,
            rgba(0, 0, 0, 0.4) 50%,
            rgba(0, 0, 0, 0.1) 100%);
}

.featured-content {
    position: relative;
    z-index: 2;
    padding: 40px 50px;
    max-width: 500px;
}

.featured-label {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
}

.featured-title {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 400;
    color: #ffffff;
    margin: 0 0 12px;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.featured-description {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    line-height: 1.6;
    font-style: italic;
}

/* Featured banner hover effect */
.featured-banner:hover .featured-image-container img {
    transform: scale(1.03);
    transition: transform 4s ease;
}

.featured-banner .featured-image-container img {
    transition: transform 0.6s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .featured-banner {
        height: 200px;
    }

    .featured-content {
        padding: 24px;
    }

    .featured-title {
        font-size: 1.5rem;
    }
}

.nav-item {
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-width: 80px;
}

/* Only enable transitions after page has loaded to prevent FOUC animation */
.nav-items.loaded .nav-item {
    transition: color 0.4s ease, transform 0.4s ease;
}

.nav-item .en {
    font-size: 1.4rem;
    margin-bottom: 0.2rem;
}

.nav-item .cn {
    font-size: 0.8rem;
    font-family: var(--font-sans);
    opacity: 0.6;
    font-weight: 300;
}

.nav-item:hover {
    color: var(--text-main);
    /* Dark on hover */
    transform: translateY(-2px);
}

.nav-item.active {
    color: var(--text-main);
    text-shadow: 0 0 20px var(--spotlight-color);
}

.nav-item.active .cn {
    opacity: 1;
    color: var(--accent-purple);
}

/* Dark mode: softer starry blue for active nav */
[data-theme="dark"] .nav-item.active .cn {
    color: #5d9fd8;
}

/* --- Gallery Grid --- */
.gallery-container {
    padding: 40px 5vw 10vh;
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 40px;
    opacity: 0;
    /* Animated in */
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.gallery-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.prompt-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    /* Soft shadow */
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    aspect-ratio: 4/3;
    /* Consistent aspect ratio */
    z-index: 2;
    /* Ensure cards are above any extended light */
}

/* Pinterest-style Favorite Button */
.card-fav-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.25s ease;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.card-fav-btn i {
    color: white;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.prompt-card:hover .card-fav-btn {
    opacity: 1;
    transform: scale(1);
}

.card-fav-btn:hover {
    background: rgba(255, 71, 87, 0.9);
    transform: scale(1.1);
}

.card-fav-btn:active {
    transform: scale(0.95);
    /* Subtle press effect */
}

/* Even if saved, hide unless hovered (parent card hover controls visibility) */
.card-fav-btn.saved {
    background: #ff4757;
}

.card-fav-btn.saved i {
    color: white;
}

/* Add click animation keyframes */
@keyframes likeBounce {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.2);
    }

    50% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
    }
}

.card-fav-btn.animating {
    animation: likeBounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-fav-btn.saved i {
    color: white;
}

/* Card entrance animation - uses transition to avoid conflict with breathing animation */
.prompt-card.card-enter {
    opacity: 0;
    transform: translateY(20px);
}

.prompt-card.card-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* Override card-visible during filtering */
.prompt-card.card-visible.filtering {
    transition: none !important;
}

/* Card image indicators */
.card-indicators {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.prompt-card:hover .card-indicators {
    opacity: 1;
}

.indicator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.indicator-dot.active {
    background: white;
    transform: scale(1.3);
}

.prompt-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    /* Stronger shadow */
    border-color: rgba(0, 0, 0, 0.1);
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease, opacity 0.4s ease;
    opacity: 0;
}

.card-image.loaded {
    opacity: 1;
}

.prompt-card:hover .card-image {
    transform: scale(1.05);
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 24px;
    padding-top: 80px;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.6) 0%,
            rgba(0, 0, 0, 0.35) 30%,
            rgba(0, 0, 0, 0.1) 60%,
            rgba(0, 0, 0, 0) 100%);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s ease;
}

.prompt-card:hover .card-overlay {
    transform: translateY(0);
    opacity: 1;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    font-family: var(--font-display);
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.card-tags {
    display: flex;
    gap: 8px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* --- Modal --- */
.poetry-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay);
    backdrop-filter: blur(20px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.poetry-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-inner {
    width: 90%;
    max-width: 1000px;
    height: 85vh;
    background: var(--modal-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    display: flex;
    overflow: hidden;
    position: relative;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.1);
    /* Softer shadow */
    transform: scale(0.92);
    transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.poetry-modal.active .modal-inner {
    transform: scale(1);
}

.modal-image-col {
    flex: 1;
    background: var(--modal-img-bg, #f1f5f9);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure images stack correctly */
.modal-image-col img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    position: absolute;
    /* Needed for stacking */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.5s ease-in-out, top 0.5s ease-in-out, transform 0.5s ease-in-out, filter 0.5s ease-in-out;
    opacity: 1;
    filter: blur(0);
    will-change: top, transform, opacity, filter;
}

/* New image entering */
.modal-next-image {
    opacity: 0 !important;
    /* Start hidden */
    z-index: 2;
    /* On top of current */
}

.modal-next-image.animate-in {
    opacity: 1 !important;
}

/* Old image (modalImg) stays underneath until removed */
#modalImg {
    z-index: 1;
}

#modalImg.animate-out {
    opacity: 0 !important;
    transition: opacity 0.3s ease-out;
}

/* Modal Image Navigation */
.modal-img-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    /* Glassmorphism effect - matching avatar dropdown */
    background: rgba(255, 255, 255, 0.70);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: none;
    /* Controlled by JS via display:flex */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 10;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    color: #1e293b;
    opacity: 0;
    /* Hidden by default */
}

/* Show arrows on hover */
.modal-image-col:hover .modal-img-nav {
    opacity: 1;
}

.modal-img-nav.left {
    left: 20px;
    transform: translateY(-50%) translateX(-10px);
    /* Slide in effect */
}

.modal-img-nav.right {
    right: 20px;
    transform: translateY(-50%) translateX(10px);
    /* Slide in effect */
}

.modal-image-col:hover .modal-img-nav.left,
.modal-image-col:hover .modal-img-nav.right {
    transform: translateY(-50%) translateX(0);
}

.modal-img-nav:hover {
    background: rgba(255, 255, 255, 0.85);
    color: #000;
    transform: translateY(-50%) scale(1.1) !important;
    /* Override slide transform */
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
}

.modal-img-nav i {
    font-size: 16px;
}

.modal-img-counter {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    color: #475569;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    display: none;
    z-index: 9;
    letter-spacing: 0.05em;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-content-col {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.modal-header {
    margin-bottom: 30px;
}

.modal-title-large {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    margin-bottom: 10px;
    line-height: 1.1;
    color: var(--text-main);
}

.modal-meta {
    display: flex;
    gap: 15px;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.modal-description {
    display: none;
}

.prompt-area {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px;
    margin-top: auto;
    /* Push to bottom */
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.prompt-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    display: block;
    margin-bottom: 12px;
    letter-spacing: 0.1em;
    color: var(--accent-purple);
    font-weight: 600;
}

.prompt-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-main);
    word-break: break-all;
    max-height: 120px;
    overflow-y: auto;
    padding-right: 10px;
}

/* --- Gallery 4.0 Spatial Flow & Comment System --- */

.prompt-text.blur-masked {
    mask-image: linear-gradient(to bottom, black 40%, transparent 95%);
    -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 95%);
    /* Gradient fade only - no blur filter */
    /* Prevent scrolling when masked to keep the mystery static */
    overflow: hidden;
    pointer-events: none;
    /* Prevent text selection cheaters */
    user-select: none;
    -webkit-user-select: none;
}

/* 2. Action Bar & Trigger Buttons */
.prompt-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--card-border);
}

.unlock-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: transparent;
    color: var(--accent-purple);
    border: 1px solid transparent;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.unlock-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.2);
    transform: translateY(-1px);
}

/* The Subtle "Ripple" Trigger */
.comment-trigger-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.comment-trigger-btn i {
    font-size: 1.1rem;
}

.comment-trigger-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
    transform: scale(1.05);
}

/* Active state - when comment section is open */
.comment-trigger-btn.active {
    background: transparent;
    color: #8b5cf6;
}

/* Hide comment count when in active/close mode */
.comment-trigger-btn.active .comment-count {
    display: none;
}

.comment-trigger-btn.active:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Dark mode - use starry blue theme */
[data-theme="dark"] .comment-trigger-btn.active {
    background: transparent;
    color: #6b9ece;
}

[data-theme="dark"] .comment-trigger-btn.active:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #f87171;
}

/* Ripple effect (simulated with shadow) */
.comment-trigger-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
    opacity: 0;
    transition: all 0.6s ease;
    pointer-events: none;
}

.comment-trigger-btn:hover::after {
    animation: simpleRipple 1.5s infinite;
}

@keyframes simpleRipple {
    0% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
        opacity: 0.8;
    }

    100% {
        box-shadow: 0 0 0 15px rgba(139, 92, 246, 0);
        opacity: 0;
    }
}

/* Dark Mode: Starry Blue for Prompt Area Elements */
[data-theme="dark"] .prompt-label {
    color: var(--accent-starry);
}

[data-theme="dark"] .unlock-btn {
    background: transparent;
    color: var(--accent-starry);
    border-color: transparent;
}

[data-theme="dark"] .unlock-btn:hover {
    background: rgba(107, 158, 206, 0.15);
    border-color: rgba(107, 158, 206, 0.25);
}

/* Dark mode ripple uses starry blue */
[data-theme="dark"] .comment-trigger-btn::after {
    box-shadow: 0 0 0 0 rgba(107, 158, 206, 0.4);
}

@keyframes simpleRippleStarry {
    0% {
        box-shadow: 0 0 0 0 rgba(107, 158, 206, 0.4);
        opacity: 0.8;
    }

    100% {
        box-shadow: 0 0 0 15px rgba(107, 158, 206, 0);
        opacity: 0;
    }
}

[data-theme="dark"] .comment-trigger-btn:hover::after {
    animation: simpleRippleStarry 1.5s infinite;
}

.comment-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: white;
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    border: 2px solid var(--card-bg);
    /* Cutout effect */
}

/* 3. Spatial Flow Layout States */

/* Target dock space in the left column - use calc to stay within bounds */
.prompt-dock-target {
    position: absolute;
    bottom: 16px;
    left: 16px;
    width: calc(100% - 32px);
    height: auto;
    z-index: 10;
    pointer-events: none;
    /* Let clicks pass through if empty */
}

/* When in Comment Mode:
   - Image moves up
   - Prompt Area is moved to left column (handled by JS reparenting usually, but we define styles here)
*/
.modal-inner.comment-mode .modal-image-col img {
    /* Image moves up */
    top: 35% !important;
    transform: translate(-50%, -50%) scale(0.85);
}

/* Motion Blur Class (Added by JS) */
.modal-image-col img.blur-motion {
    filter: blur(1.5px);
}

/* DOCKED Prompt Styling (When prompt is in the left column) */
.prompt-area.docked {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 12px;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    animation: promptDockIn 0.5s ease-in-out forwards;
    pointer-events: auto;
    /* Re-enable clicks on docked prompt */
}

/* Limit prompt text height when docked */
.prompt-area.docked .prompt-text {
    max-height: 80px;
}

[data-theme="dark"] .prompt-area.docked {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(255, 255, 255, 0.1);
}

@keyframes promptDockIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

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

@keyframes promptReturn {
    from {
        opacity: 0;
        transform: translateX(-40px);
        /* Slide from left to right */
    }

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

.prompt-area.returning {
    animation: promptReturn 0.5s ease-in-out forwards;
}

/* 4. Clean Stream Comment Section */
.modal-inner.comment-mode .modal-content-col {
    overflow: hidden;
    /* Lock outer scroll, enable inner scroll */
}

.comment-section {
    position: relative;
    display: none;
    flex: 1;
    min-height: 0;
    /* Critical: allows flex child to shrink below content size */
    max-height: 100%;
    /* Prevent growing beyond parent */
    overflow: hidden;
    /* Contain children */
    flex-direction: column;
    margin-top: 20px;
    padding-right: 12px;
    /* Room for dropdown shadow */
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.modal-inner.comment-mode .comment-section {
    display: flex;
    opacity: 1;
    transform: translateY(0);
    animation: commentsFadeIn 0.4s ease 0.2s backwards;
    /* Staggered delay */
}

@keyframes commentsFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.comment-list {
    flex: 1;
    min-height: 0;
    /* Critical: allows flex child to scroll properly */
    overflow-y: auto;
    padding-left: 8px;
    /* Room for avatar shadow (8px spread) */
    padding-right: 8px;
    /* Room for scrollbar */
    margin-bottom: 60px;
    /* Space for input bar */
}

/* Custom Scrollbar for comments */
.comment-list::-webkit-scrollbar {
    width: 4px;
}

.comment-list::-webkit-scrollbar-track {
    background: transparent;
}

.comment-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

/* Single Comment Item */
.comment-item {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    /* Reduced from 12px */
    padding-bottom: 6px;
    /* Reduced from 8px */
    font-size: 0.95rem;
    position: relative;
}

/* Only show separator in light mode */
/* Remove default border-bottom from all items */
.comment-item {
    border-bottom: none;
}

/* Default (Light Mode) - Separators for threads */
.comment-item:not(.comment-reply) {
    border-top: 1px solid #e5e7eb;
    padding-top: 10px;
    /* Reduced from 12px */
}

/* No border for the very first comment */
.comment-item:first-child {
    border-top: none;
    padding-top: 0;
}

/* Dark mode separators - Strict Thread Separation */
[data-theme="dark"] .comment-item {
    border-bottom: none;
}

[data-theme="dark"] .comment-item:not(.comment-reply) {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 12px;
}

[data-theme="dark"] .comment-item:first-child {
    border-top: none;
    padding-top: 0;
}

.comment-item:last-child {
    margin-bottom: 8px;
}

/* Reply Comments - Thread Styling */
.comment-item.comment-reply {
    margin-left: 24px;
    padding-left: 20px;
}

/* Thread Line - Vertical connector */
.comment-item.comment-reply .thread-line {
    position: absolute;
    left: 0;
    top: -8px;
    bottom: 0;
    width: 1px;
    background: var(--card-border);
}

/* For the last reply, shorter thread line */
.comment-item.comment-reply.last-reply .thread-line {
    bottom: auto;
    height: 26px;
}

/* "Replying to @username" text */
.comment-replying-to {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 4px;
}

/* Light mode thread line - uses same --card-border variable */

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.comment-body {
    flex: 1;
    min-width: 0;
    /* Prevent content overflow */
}

.comment-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
}

.comment-author {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
}

.comment-time {
    font-size: 0.75rem;
    color: var(--text-dim);
    opacity: 0.7;
}

.comment-content {
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 10px;
}

/* Comment @mentions */
.comment-mention {
    color: var(--accent-starry, #6b9ece);
    font-weight: 500;
}

[data-theme="light"] .comment-mention {
    color: var(--accent-purple, #8b5cf6);
}

/* Comment Actions - Hidden by default, show on hover */
.comment-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.comment-item:hover .comment-actions {
    opacity: 1;
}

/* Action Button - Pill style with soft hover */
.comment-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.25s ease;
}

.comment-action-btn:hover {
    background: rgba(107, 158, 206, 0.12);
    color: var(--accent-starry, #6b9ece);
}

[data-theme="light"] .comment-action-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-purple, #8b5cf6);
}

.comment-action-btn i {
    font-size: 0.85rem;
}

/* Liked state */
.comment-action-btn.liked {
    color: #ef4444;
}

.comment-action-btn.liked:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* --- Comment Header & Sorting --- */
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px 8px 4px;
    margin-bottom: 8px;
    overflow: visible;
    /* Allow dropdown shadow to show */
}

.comment-header-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dim);
    /* Match sort button color */
    cursor: pointer;
    transition: color 0.2s;
}

.comment-header-title:hover {
    color: var(--text-primary);
}



/* Collapse functionality */
.comment-item.hidden-collapsed {
    display: none !important;
}

.comment-sort-wrapper {
    position: relative;
    z-index: 20;
    /* Ensure dropdown is satisfyingly above other content */
}

.comment-sort-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    /* Slightly larger */
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    /* More clickable area */
    border-radius: 8px;
    transition: all 0.2s ease;
}

.comment-sort-btn:hover {
    background: rgba(128, 128, 128, 0.1);
    color: var(--text-primary);
}

.comment-sort-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: var(--modal-bg);
    border: 1px solid rgba(128, 128, 128, 0.1);
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    padding: 6px;
    min-width: 140px;
    display: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.comment-sort-dropdown.show {
    display: block;
    animation: fadeInScale 0.15s ease-out;
}

.sort-option {
    padding: 6px 10px;
    /* Reduced padding */
    font-size: 0.85rem;
    /* Slightly smaller font */
    color: var(--text-dim);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    /* No bold by default */
}

.sort-option:hover {
    background: rgba(128, 128, 128, 0.08);
    color: var(--text-primary);
}

.sort-option.active {
    color: var(--text-primary);
    background: rgba(128, 128, 128, 0.05);
    font-weight: 500;
    /* Subtle weight for active, not full bold */
}

/* Light mode specifics for sort dropdown */
[data-theme="light"] .comment-sort-dropdown {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-5px);
    }

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

/* 5. Floating Input Bar */
.comment-input-area {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 16px 40px 20px;
    /* Solid background to block content behind when textarea expands */
    background: var(--modal-bg);
    display: flex;
    gap: 12px;
    align-items: flex-end;
    /* Align to bottom for expanding textarea */
    /* Add subtle top border for separation */
    border-top: 1px solid rgba(128, 128, 128, 0.1);
}

#commentInput {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--card-border);
    padding: 0 0 8px 0;
    /* Only bottom padding to sit on line */
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
    /* Textarea auto-expand support */
    resize: none;
    overflow-y: hidden;
    min-height: 1.5em;
    /* One line height */
    max-height: 120px;
    /* About 5 lines max */
    line-height: 1.5;
    vertical-align: bottom;
}

#commentInput:focus {
    outline: none;
    border-bottom-color: var(--accent-purple);
}

.send-comment-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s ease;
    padding: 8px;
    flex-shrink: 0;
}

.send-comment-btn:hover {
    opacity: 1;
    color: var(--accent-purple);
}

/* Dark Mode: Starry Blue for Comment Section */
[data-theme="dark"] #commentInput:focus {
    border-bottom-color: var(--accent-starry);
}

[data-theme="dark"] .send-comment-btn:hover {
    color: var(--accent-starry);
}

[data-theme="dark"] .comment-action-btn.reply-btn {
    color: var(--accent-starry);
}

/* @mention styling for both themes */
.mention {
    color: var(--accent-purple);
    font-weight: 500;
}

[data-theme="dark"] .mention {
    color: var(--accent-starry);
}

/* Mobile Fallback: Bottom Sheet (Optional override) */
@media (max-width: 768px) {
    .modal-inner {
        flex-direction: column;
        overflow-y: auto;
        /* Let layout flow naturally */
    }

    .modal-image-col {
        height: 40vh;
        /* Shorter image area */
    }

    .prompt-dock-target {
        display: none;
        /* No docking on mobile */
    }

    .modal-content-col {
        padding: 24px;
    }

    /* Mobile comment mode: just expand */
    .modal-inner.comment-mode .modal-image-col img {
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
}



.close-modal-btn {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1e293b;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.close-modal-btn:hover {
    background: #1e293b;
    color: white;
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .close-modal-btn {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

[data-theme="dark"] .close-modal-btn:hover {
    background: white;
    color: #1e293b;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-items {
        gap: 1.5rem;
    }

    .nav-item .en {
        font-size: 1.1rem;
    }

    .modal-inner {
        flex-direction: column;
        height: 90vh;
        width: 95%;
    }

    .modal-image-col {
        height: 40%;
    }

    .modal-content-col {
        height: 60%;
        padding: 24px;
    }

    .modal-title-large {
        font-size: 1.8rem;
    }
}

/* Disclaimer Footer */
.disclaimer-footer {
    margin-top: 80px;
    padding: 60px 5vw;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.02));
    border-top: 1px solid var(--footer-border);
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 1.5s;
    /* Appear after cards load */
}

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

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

[data-theme="dark"] .disclaimer-footer {
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.02));
    border-top-color: rgba(255, 255, 255, 0.12);
}

.disclaimer-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.disclaimer-title {
    font-family: var(--font-serif);
    font-size: 0.9rem;
    color: #94a3b8;
    letter-spacing: 0.15em;
    margin-bottom: 20px;
}

.disclaimer-text {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.8;
    margin-bottom: 16px;
}

.disclaimer-text-en {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.7;
    font-style: italic;
}

/* Comment Collapse/Expand */
.comment-expand-toggle {
    padding: 15px 30px 10px;
    text-align: left;
    font-size: 0.9rem;
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.2s ease;
    user-select: none;
}

.comment-expand-toggle:hover {
    color: var(--accent-purple);
}

[data-theme="dark"] .comment-expand-toggle:hover {
    color: var(--accent-starry);
}



/* ===================================
   COMMENT IMAGE ATTACHMENTS
   =================================== */

/* Upload button - subtle and unobtrusive */
.comment-upload-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 8px;
    opacity: 0.5;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

/* Only brighten on hover, not by default */
.comment-upload-btn:hover {
    opacity: 0.7;
}

/* Active state when image is selected */
.comment-upload-btn.has-image {
    opacity: 1;
    color: var(--accent-purple);
}

[data-theme="dark"] .comment-upload-btn.has-image {
    color: var(--accent-starry);
}

/* View Image button in comment actions */
.view-image-btn:hover {
    color: var(--accent-purple);
}

[data-theme="dark"] .view-image-btn:hover {
    color: var(--accent-starry);
}

/* Image modal/lightbox */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.image-lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.image-lightbox img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Dark mode input focus */
[data-theme="dark"] #commentInput:focus {
    border-bottom-color: var(--accent-starry);
}

/* Dark mode image navigation */
[data-theme="dark"] .modal-img-nav {
    background: rgba(30, 41, 59, 0.65);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

[data-theme="dark"] .modal-img-nav:hover {
    background: rgba(30, 41, 59, 0.80);
    color: #ffffff;
}

/* ===================================
   REAL-TIME COMMENT UPDATES
   =================================== */

/* New comment fade-in animation */
.comment-item.new-comment {
    animation: fadeInComment 0.5s ease;
}

@keyframes fadeInComment {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

/* Gentle highlight for newly viewed comments */
.comment-item.highlight {
    background: rgba(107, 158, 206, 0.08);
    transition: background 2s ease;
}

[data-theme="dark"] .comment-item.highlight {
    background: rgba(107, 158, 206, 0.12);
}

.comment-item.highlight.fade-out {
    background: transparent;
}

/* ========================================
   Pinned Comments (Feature removed)
   ======================================== */

/* Hide inline pin icon - pinned comments are just sorted to top */
.pinned-icon {
    display: none;
}