/* CSS Reset & Variables */
:root {
    --primary-color: #15575f;
    --primary-light: #2a9d8f;
    --primary-dark: #0e3d42;
    --accent-color: #fca311;
    --bg-color: #0b0d10;
    --card-bg: rgba(30, 35, 40, 0.6);
    --text-main: #f0f4f8;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-blur: 12px;
    --nav-height: 80px;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

/* Light Theme */
[data-theme="light"] {
    --bg-color: #f5f7fa;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-main: #1a1a2e;
    --text-muted: #64748b;
    --border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .bg-gradient {
    background: radial-gradient(ellipse at 50% 0%, rgba(42, 157, 143, 0.15) 0%, transparent 60%);
}

[data-theme="light"] .bg-blur {
    background: radial-gradient(circle at 80% 80%, rgba(21, 87, 95, 0.08) 0%, transparent 50%);
}

[data-theme="light"] .search-box {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .search-box input {
    color: var(--text-main);
}

[data-theme="light"] .filter-btn,
[data-theme="light"] .filter-select {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-main);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .card {
    background: var(--card-bg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .modal-content {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-main);
}

[data-theme="light"] .app-card {
    background: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .app-icon {
    background: rgba(42, 157, 143, 0.15);
    color: var(--primary-color);
}

[data-theme="light"] .settings-btn,
[data-theme="light"] .lang-btn {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .settings-btn:hover,
[data-theme="light"] .lang-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Light Theme - Complete Adaptation */
/* Logo */
[data-theme="light"] .logo-area h1 {
    background: linear-gradient(135deg, #0e3d42 0%, #15575f 50%, #2a9d8f 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .logo-area h1 .dot {
    -webkit-text-fill-color: var(--accent-color);
}

[data-theme="light"] .logo-area h1 .art {
    -webkit-text-fill-color: var(--primary-color);
}

[data-theme="light"] .subtitle {
    color: var(--text-muted);
}

/* Filter Bar */
[data-theme="light"] .filter-bar {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .filter-btn.active {
    background: var(--primary-color);
    color: white;
}

[data-theme="light"] .filter-select option {
    background: white;
    color: var(--text-main);
}

/* Cards */
[data-theme="light"] .card-content h3 {
    color: var(--text-main);
}

[data-theme="light"] .card-meta {
    color: var(--text-muted);
}

[data-theme="light"] .tag {
    background: rgba(42, 157, 143, 0.15);
    color: var(--primary-color);
}

[data-theme="light"] .admin-actions button {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
}

[data-theme="light"] .admin-actions button:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-main);
}

/* Detail Modal */
[data-theme="light"] .detail-content h2 {
    color: var(--text-main);
}

[data-theme="light"] .detail-content .meta {
    color: var(--text-muted);
}

[data-theme="light"] .detail-content .content-body {
    color: var(--text-main);
}

[data-theme="light"] .detail-content .content-body p {
    color: var(--text-main);
}

[data-theme="light"] .comments-section {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .comments-section h4 {
    color: var(--text-main);
}

[data-theme="light"] .comment-input {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-main);
}

[data-theme="light"] .comment-input::placeholder {
    color: var(--text-muted);
}

/* Editor Modal */
[data-theme="light"] .modal-content h2 {
    color: var(--text-main);
}

[data-theme="light"] .modal-content label {
    color: var(--text-main);
}

[data-theme="light"] .modal-content input,
[data-theme="light"] .modal-content select,
[data-theme="light"] .modal-content textarea {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--text-main);
}

[data-theme="light"] .modal-content input::placeholder,
[data-theme="light"] .modal-content textarea::placeholder {
    color: var(--text-muted);
}

[data-theme="light"] .upload-zone {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .upload-zone:hover {
    border-color: var(--primary-color);
    background: rgba(42, 157, 143, 0.05);
}

[data-theme="light"] .upload-message {
    color: var(--text-muted);
}

[data-theme="light"] .upload-message i {
    color: var(--primary-color);
}

/* Image Description Box */
[data-theme="light"] .image-description-box {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .image-description-box .desc-text {
    color: var(--text-main);
}

[data-theme="light"] .image-description-box .copy-btn {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-muted);
}

[data-theme="light"] .image-description-box .copy-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Tag Wall */
[data-theme="light"] .tag-wall {
    background: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .app-name {
    color: var(--text-main);
}

/* Carousel */
[data-theme="light"] .carousel-nav {
    background: rgba(0, 0, 0, 0.5);
    color: white;
}

[data-theme="light"] .carousel-dot {
    background: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .carousel-dot.active {
    background: var(--primary-color);
}

/* FAB Buttons */
[data-theme="light"] .fab-btn {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* Video Card Overlay */
[data-theme="light"] .video-overlay {
    background: rgba(0, 0, 0, 0.4);
}

/* Close Modal Button */
[data-theme="light"] .close-modal {
    color: var(--text-muted);
}

[data-theme="light"] .close-modal:hover {
    color: var(--text-main);
}

/* Image Count Badge */
[data-theme="light"] .image-count {
    background: rgba(0, 0, 0, 0.7);
    color: white;
}

/* Admin Login Modal */
[data-theme="light"] .admin-trigger {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-main);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Scrollbar */
[data-theme="light"] ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Settings Group - Integrated with Search */
.settings-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.settings-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-light);
    transform: scale(1.05);
}

.lang-toggle {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.08);
    padding: 4px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.lang-btn {
    padding: 6px 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    color: var(--text-main);
}

.lang-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(42, 157, 143, 0.3);
}

/* Search Container - Flex layout */
.search-container {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.search-box {
    flex: 1;
}

/* Mobile Responsive for Settings */
@media (max-width: 480px) {
    .search-container {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .search-box {
        width: 100%;
        order: 1;
    }
    
    .settings-group {
        order: 2;
        width: 100%;
        justify-content: center;
        margin-top: 5px;
    }
    
    .settings-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .lang-btn {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Noto Sans SC', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Background Effects - 柔和过度 */
.bg-gradient {
    position: fixed;
    top: -30%;
    left: -30%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 30%, var(--primary-color) 0%, transparent 60%);
    opacity: 0.15;
    z-index: -1;
    animation: floatBg 20s infinite ease-in-out;
    filter: blur(80px);
}

.bg-blur {
    position: fixed;
    bottom: -30%;
    right: -30%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 80% 80%, var(--primary-light) 0%, transparent 60%);
    opacity: 0.1;
    z-index: -1;
    animation: floatBg2 25s infinite ease-in-out;
    filter: blur(100px);
}

@keyframes floatBg {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(50px, 50px) scale(1.05);
    }
    100% {
        transform: translate(0, 0) scale(1);
    }
}

@keyframes floatBg2 {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(-60px, -40px) scale(0.95);
    }
    100% {
        transform: translate(0, 0) scale(1);
    }
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Responsive Container */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem 0.8rem;
    }
}

/* Header & Typography */
.header {
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
}

.logo-area {
    margin-bottom: 2rem;
    padding-top: 1.5rem;
}

/* Brand Logo with Image */
.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.brand-logo-img {
    width: 70px;
    height: 70px;
    border-radius: 18px;
    object-fit: cover;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.brand-logo-img:hover {
    transform: scale(1.05) rotate(3deg);
    box-shadow: 0 8px 30px rgba(106, 200, 180, 0.4);
}

.brand-text {
    text-align: left;
}

.brand-text h1 {
    margin-bottom: 0.25rem;
}

.brand-text .subtitle {
    margin: 0;
}

/* Light theme brand logo */
[data-theme="light"] .brand-logo-img {
    box-shadow: none;
}

[data-theme="light"] .brand-logo-img:hover {
    box-shadow: none;
}

.logo-area h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #fff 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.logo-area .dot {
    color: var(--primary-light);
    -webkit-text-fill-color: var(--primary-light);
}

.logo-area .art {
    font-size: 1rem;
    letter-spacing: 4px;
    background: none;
    -webkit-text-fill-color: var(--text-muted);
    font-weight: 300;
    margin-left: 10px;
    text-transform: uppercase;
    vertical-align: middle;
}

/* Responsive Header for Mobile */
@media (max-width: 768px) {
    .logo-area h1 {
        font-size: 2.5rem;
    }
    
    .brand-logo-img {
        width: 55px;
        height: 55px;
        border-radius: 14px;
    }
}

@media (max-width: 480px) {
    .header {
        margin-bottom: 1.5rem;
    }

    .logo-area {
        margin-bottom: 1rem;
        padding-top: 1rem;
    }

    .logo-area h1 {
        font-size: 2rem;
        margin-bottom: 0.3rem;
    }
    
    .brand-logo {
        gap: 0.75rem;
    }
    
    .brand-logo-img {
        width: 45px;
        height: 45px;
        border-radius: 12px;
    }

    .subtitle {
        font-size: 0.9rem;
    }
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 300;
}

/* Search Bar */
.search-container {
    max-width: 600px;
    margin: 0 auto 1.5rem;
    position: relative;
    z-index: 100;
    padding: 0 1rem;
}

.search-box {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 0.8rem 1.5rem;
    backdrop-filter: blur(var(--glass-blur));
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.search-box:focus-within {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-light);
    box-shadow: 0 0 15px rgba(21, 87, 95, 0.3);
    transform: scale(1.02);
}

.search-icon {
    color: var(--text-muted);
    margin-right: 10px;
}

.search-box input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Responsive Search for Mobile */
@media (max-width: 768px) {
    .search-container {
        margin: 0 auto 1rem;
    }

    .search-box {
        padding: 0.7rem 1.2rem;
        border-radius: 30px;
    }

    .search-box input {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .search-container {
        margin: 0 auto 0.8rem;
        padding: 0 0.5rem;
    }

    .search-box {
        padding: 0.6rem 1rem;
    }

    .search-icon {
        font-size: 0.9rem;
        margin-right: 8px;
    }

    .search-box input {
        font-size: 0.9rem;
    }
}

/* Sticky Tag Wall - App Grid Style */
.tag-wall {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
    position: sticky;
    top: 20px;
    z-index: 90;
    padding: 1.5rem;
    background: rgba(11, 13, 16, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

/* App Card Style */
.app-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(30, 35, 40, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.app-card:hover {
    background: rgba(30, 35, 40, 0.8);
    border-color: var(--primary-light);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(42, 157, 143, 0.2);
}

.app-icon {
    font-size: 1.8rem;
    color: var(--primary-light);
    line-height: 1;
    transition: all 0.3s ease;
}

.app-card:hover .app-icon {
    color: var(--accent-color);
    font-size: 2rem;
}

.app-name {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.app-card:hover .app-name {
    color: var(--text-main);
}

/* Responsive Design for Mobile */
@media (max-width: 768px) {
    .tag-wall {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 0.8rem;
        padding: 1rem;
        margin: 0 -1rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .app-card {
        padding: 0.8rem 0.5rem;
    }

    .app-icon {
        font-size: 1.6rem;
    }

    .app-name {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .tag-wall {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.6rem;
        padding: 0.8rem;
    }

    .app-card {
        padding: 0.6rem 0.4rem;
    }

    .app-icon {
        font-size: 1.4rem;
    }

    .app-name {
        font-size: 0.65rem;
    }
}

/* CSS Masonry Layout - True Pinterest Style (Safari Compatible) */
.masonry-grid {
    column-count: auto;
    column-width: 320px;
    gap: 1.5rem;
    -webkit-column-count: auto;
    -webkit-column-width: 320px;
    -webkit-column-gap: 1.5rem;
    /* 让列自动适配，卡片会紧凑排列 */
}

@media (max-width: 768px) {
    .masonry-grid {
        column-width: 250px;
        -webkit-column-width: 250px;
    }
}

@media (max-width: 480px) {
    .masonry-grid {
        column-width: 100%;
        -webkit-column-width: 100%;
        column-count: 1;
        -webkit-column-count: 1;
    }
}

/* Feed Card */
.feed-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    width: 100%;
    min-height: 100px;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    margin-bottom: 1.5rem;
    opacity: 1;
    visibility: visible;
}

.feed-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Card Content Types */
.card-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.2);
    display: block;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.card-text {
    color: #cbd5e1;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.card-tag {
    background: rgba(21, 87, 95, 0.3);
    color: var(--primary-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

/* Card Media Wrapper - for card thumbnails (Safari compatible) */
.card-media-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    background: #000;
}

.card-media-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-sm);
}

/* Video Container */
.video-container {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    background: #000;
}

/* Video container with iframe needs aspect ratio */
.video-container:has(iframe) {
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
}

/* For browsers that don't support :has (older Safari) */
@supports not selector(:has(iframe)) {
    .video-container iframe {
        aspect-ratio: 16/9;
        width: 100%;
        height: auto;
    }
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Card Actions & Comments */
.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.8rem;
    margin-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.action-btn:hover {
    color: var(--primary-light);
}

.admin-only {
    display: none;
    /* Shown by JS if admin */
}

/* Comment Section */
.comments-section {
    margin-top: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: 1rem;
    display: none;
    /* Hidden by default */
}

.comments-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.comment-list {
    list-style: none;
    margin-bottom: 0.5rem;
    max-height: 150px;
    overflow-y: auto;
}

.comment-item {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.comment-user {
    font-weight: 700;
    color: var(--primary-light);
    margin-right: 5px;
}

.comment-input-area {
    display: flex;
    gap: 5px;
}

.comment-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    color: #fff;
    font-size: 0.85rem;
}

.comment-submit {
    background: var(--primary-color);
    border: none;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

/* Floating Action Button Group */
.fab-group {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column-reverse;
    /* Stack upwards */
    gap: 15px;
    align-items: center;
    z-index: 200;
}

.fab-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-color);
    border: none;
    color: #000;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(252, 163, 17, 0.4);
    transition: all 0.3s ease;
    display: grid;
    place-items: center;
}

.fab-btn:hover {
    transform: scale(1.1);
}

.sub-fab {
    width: 45px;
    height: 45px;
    font-size: 1rem;
    background: #334155;
    color: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.sub-fab:hover {
    background: var(--primary-light);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #1e262f;
    padding: 2rem;
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 400px;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-content.large-modal {
    max-width: 600px;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.close-modal:hover {
    color: #fff;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.modal-input {
    width: 100%;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: inherit;
}

.modal-input:focus {
    border-color: var(--primary-light);
    outline: none;
}

.modal-btn {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    background: #334155;
    color: #fff;
    transition: background 0.3s;
}

.modal-btn.primary {
    background: var(--primary-color);
}

.modal-btn:hover {
    opacity: 0.9;
}

/* Upload Zone (WYSIWYG) */
.upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary-light);
    background: rgba(21, 87, 95, 0.1);
}

.upload-message {
    color: var(--text-muted);
    pointer-events: none;
    /* Let clicks pass through to container */
}

.upload-message i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-light);
}

.upload-message p {
    font-size: 0.9rem;
}

.upload-input-hidden {
    display: none;
}

/* Multi-Image Preview */
.multi-image-preview {
    display: none;
    width: 100%;
    gap: 0.8rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.multi-image-preview.active {
    display: flex;
}

.image-thumbnail {
    position: relative;
    width: calc(20% - 0.64rem);
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-thumbnail:hover {
    border-color: var(--primary-light);
    box-shadow: 0 0 10px rgba(42, 157, 143, 0.3);
}

.image-thumbnail.active {
    border-color: var(--primary-light);
    box-shadow: 0 0 15px rgba(42, 157, 143, 0.5);
}

.image-thumbnail .remove-thumb-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    opacity: 0;
}

.image-thumbnail:hover .remove-thumb-btn {
    opacity: 1;
}

.image-thumbnail .remove-thumb-btn:hover {
    background: rgba(255, 71, 87, 0.8);
}

.image-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 0.4rem;
    color: white;
    font-size: 0.7rem;
    text-align: center;
}

/* Preview State */
.media-preview-container {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background: #000;
}

.media-preview-container.active {
    display: flex;
    /* Show when active */
    justify-content: center;
    align-items: center;
}

/* Image Carousel in Detail View */
.image-carousel {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1rem;
}

.carousel-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-image {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    animation: fadeIn 0.3s ease;
    display: block;
    margin: 0 auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.carousel-dot.active {
    background: white;
    width: 24px;
    border-radius: 4px;
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* 图片描述 - 液态玻璃代码框样式 */
.image-description {
    position: relative;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.08) 0%, 
        rgba(255, 255, 255, 0.03) 50%,
        rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1rem 1.2rem;
    padding-right: 3rem; /* 为复制按钮留空间 */
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-top: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    font-family: 'SF Mono', 'Consolas', 'Monaco', 'Menlo', monospace;
    word-break: break-word;
    overflow-wrap: break-word;
    transition: all 0.3s ease;
}

.image-description:hover {
    border-color: rgba(42, 157, 143, 0.4);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(42, 157, 143, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* 复制按钮 */
.image-description .copy-btn {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.image-description .copy-btn:hover {
    background: rgba(42, 157, 143, 0.3);
    border-color: var(--primary-light);
    color: var(--text-main);
    transform: scale(1.05);
}

.image-description .copy-btn.copied {
    background: rgba(42, 157, 143, 0.5);
    color: #fff;
}

/* 描述文本 */
.image-description .desc-text {
    display: block;
    user-select: all;
}

/* Responsive Multi-Image Preview */
@media (max-width: 768px) {
    .image-thumbnail {
        width: calc(25% - 0.6rem);
    }
}

@media (max-width: 480px) {
    .image-thumbnail {
        width: calc(33.33% - 0.53rem);
    }

    .carousel-nav {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

/* =========================================
   NEW FILTER BAR (Modern & Horizontal)
   ========================================= */
.filter-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin: 0 0 2rem 0;
    padding: 1rem 1.5rem;
    background: rgba(30, 30, 35, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    flex-wrap: wrap;
    gap: 0.8rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid transparent;
    /* Prevent layout shift */
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--primary-accent);
    color: white;
    box-shadow: 0 2px 10px rgba(35, 173, 229, 0.3);
}

.filter-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: rgba(255, 255, 255, 0.05);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.6rem 2.5rem 0.6rem 1.2rem;
    border-radius: 12px;
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.filter-select:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Responsive Filter Bar for Tablet */
@media (max-width: 1024px) {
    .filter-bar {
        justify-content: flex-start;
    }

    .filter-group {
        gap: 0.6rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .filter-select {
        padding: 0.5rem 2.2rem 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Responsive Filter Bar for Mobile */
@media (max-width: 768px) {
    .filter-bar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
        padding: 0.8rem 1rem;
        margin: 0 0 1.5rem 0;
    }

    .filter-group {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }

    .filter-select {
        width: 100%;
        padding: 0.5rem 2rem 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .filter-bar {
        grid-template-columns: 1fr;
        gap: 0.6rem;
        padding: 0.6rem 0.8rem;
    }

    .filter-btn {
        width: 100%;
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .filter-select {
        width: 100%;
        padding: 0.5rem 1.8rem 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Video Container & Icon Centering */
.video-container {
    position: relative;
    width: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
}

/* Ensure play icon is centered */
.play-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3.5rem;
    color: #ff0000;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
    pointer-events: none;
    /* Let clicks pass through to card */
    z-index: 2;
    transition: transform 0.2s ease;
}

.feed-card:hover .play-icon-overlay {
    transform: translate(-50%, -50%) scale(1.1);
}



.media-preview-container.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.remove-media-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.3s;
}

.remove-media-btn:hover {
    background: #ff4757;
}

/* URL Input overrides */
.url-input-row {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

/* Form Layout */
.form-row {
    display: flex;
    gap: 15px;
}

.form-group.half {
    flex: 1;
}

/* Footer */
.footer {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    opacity: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Detail Modal specific (MOVED TO END FOR PRECEDENCE) */
.detail-modal-content {
    background: #1e262f;
    width: 90%;
    max-width: 1000px !important;
    /* Force override */
    height: auto;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: 0 30px 60px -10px rgba(0, 0, 0, 0.6);
}

.detail-body {
    flex: 1;
}

.detail-media {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 2rem;
    background: transparent;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.detail-title {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.detail-meta {
    display: flex;
    gap: 20px;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1.5rem;
}

.detail-text {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #e2e8f0;
    white-space: pre-wrap;
    /* Preserve formatting */
}