:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: 1px solid rgba(255, 255, 255, 0.2);
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* ===== Ad Box Styles ===== */
.ad-box-dashed {
    border: 2px dashed #e2e8f0 !important;
    border-radius: 1rem;
    background: #fff;
    transition: all 0.3s ease;
}

.ad-box-dashed:hover {
    border-color: #cbd5e1 !important;
}

/* ===== Navbar Logo ===== */
.navbar-logo {
    width: 40px;
    height: 40px;
    font-weight: 900;
    font-size: 1.2rem;
    font-family: 'SimHei', sans-serif;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

html {
    overflow-y: scroll;
    /* Force scrollbar to prevent layout jump */
}

.border-dashed {
    border-style: dashed !important;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f8f9fa;
    color: #2d3748;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 70px;
}

/* 防止 Viewer.js 锁定页面滚动导致浏览器假死 (兼容 Edge 插件) */
body.viewer-open {
    overflow: auto !important;
    padding-right: 0 !important;
}

.navbar {
    backdrop-filter: blur(12px);
    background-color: rgba(255, 255, 255, 0.85) !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.08);
    /* Enhanced Shadow */
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(var(--bs-primary-rgb), 0.1);
    /* Subtle Primary Border */
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
    color: inherit !important;
}

.nav-link {
    font-weight: 500;
    color: #4a5568 !important;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--bs-primary) !important;
    background: rgba(var(--bs-primary-rgb), 0.1);
    font-weight: 600;
    border-radius: 0.5rem;
}

/* Ensure Navbar items specifically get the premium pill look if they are active */
.navbar-nav .nav-link.active {
    background-color: var(--bs-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(var(--bs-primary-rgb), 0.3);
}

/* Result Tabs (Homepage) - Ensure white text on active pills */
.nav-pills .nav-link.active {
    background-color: var(--bs-primary) !important;
    color: #ffffff !important;
}

.navbar-nav .nav-link:not(.active):hover {
    background: rgba(var(--bs-primary-rgb), 0.08);
    color: var(--bs-primary) !important;
}

.navbar-nav .nav-link.active:hover {
    background-color: var(--bs-primary) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow: 0 6px 14px rgba(var(--bs-primary-rgb), 0.35);
}

.navbar-nav .nav-link:hover i,
.navbar-nav .nav-link.active i {
    color: inherit !important;
}

.nav-link i {
    margin-right: 5px;
}

.main-container {
    flex: 1;
    padding-top: 16px;
}

/* Badge Customization */
.badge-custom {
    background: var(--primary-gradient);
    font-weight: 500;
}

/* Ad Box Styling */
.ad-box {
    position: relative;
    border: 2px dashed #cbd5e1;
    background-color: #f8fafc;
    border-radius: 1rem;
    transition: all 0.3s ease;
    max-width: 100%;
    overflow: hidden;
}

.ad-box:hover {
    border-color: #94a3b8;
    background-color: #f1f5f9;
}

.ad-box-dashed {
    max-width: 100%;
    overflow: hidden;
}

.ad-box img,
.ad-box video,
.ad-box canvas,
.ad-box svg,
.ad-box iframe,
.ad-box-dashed img,
.ad-box-dashed video,
.ad-box-dashed canvas,
.ad-box-dashed svg,
.ad-box-dashed iframe {
    max-width: 100% !important;
    height: auto !important;
}

.ad-box table,
.ad-box-dashed table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

.ad-box a,
.ad-box-dashed a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ad-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    color: #94a3b8;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0.5;
    transition: all 0.2s;
    z-index: 10;
}

.ad-close-btn:hover {
    opacity: 1;
    color: #64748b;
    transform: scale(1.1);
}

/* ===== Info Page Styles ===== */
.info-hero {
    background: linear-gradient(135deg, var(--bs-primary) 0%, #667eea 100%);
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.info-hero h4 {
    color: white;
    font-weight: 600;
}

.info-hero .text-white-50 {
    color: rgba(255, 255, 255, 0.7) !important;
}

.image-preview-container {
    background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    padding: 20px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.image-preview-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><rect width="10" height="10" fill="%23ddd"/><rect width="10" height="10" x="10" y="10" fill="%23ddd"/></svg>');
    background-size: 20px 20px;
    opacity: 0.3;
    z-index: 0;
}

.image-preview-container img {
    position: relative;
    z-index: 1;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.image-preview-container img:hover {
    transform: scale(1.02);
}

.info-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.info-card .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-bottom: 1px solid #eee;
    padding: 1rem 1.5rem;
}

.info-card .card-header h5 {
    margin: 0;
    font-weight: 600;
    color: #333;
}

.info-table {
    margin: 0;
    width: 100%;
    table-layout: fixed;
}

.info-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f1f1f1;
}

.info-table tr:last-child td {
    border-bottom: none;
}

.info-table .label {
    color: #6c757d;
    font-size: 0.9rem;
    width: 120px;
    white-space: nowrap;
}

.info-table .value {
    color: #333;
    font-weight: 500;
}

.admin-section {
    background: linear-gradient(135deg, #fff3cd 0%, #fff 100%);
    border-left: 4px solid #ffc107;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
}

.action-btn {
    border-radius: 12px;
    padding: 0.6rem 1.2rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.share-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.share-input-group {
    border-radius: 12px;
    overflow: hidden;
}

.share-input-group .input-group-text {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-right: none;
}

.share-input-group .form-control {
    border: 1px solid #dee2e6;
    border-left: none;
    border-right: none;
}

.share-input-group .btn {
    border-radius: 0 12px 12px 0 !important;
    padding: 0.6rem 1.2rem;
}

.random-image-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.random-image-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.random-image-card img {
    transition: transform 0.3s ease;
}

.random-image-card:hover img {
    transform: scale(1.05);
}

.status-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ===== Custom Checkbox for Image List ===== */
.form-check-input[type="checkbox"] {
    width: 1.15em;
    height: 1.15em;
    border: 2px solid #c5ccd6;
    border-radius: 0.3em;
    background-color: #fff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.form-check-input[type="checkbox"]:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.15rem rgba(var(--bs-primary-rgb), 0.1);
}

.form-check-input[type="checkbox"]:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.15rem rgba(var(--bs-primary-rgb), 0.15);
}

.form-check-input[type="checkbox"]:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.15);
    border-color: rgba(var(--bs-primary-rgb), 0.4);
}

/* ===== Mobile Navbar: horizontal nav instead of dropdown ===== */
@media (max-width: 991.98px) {
    .navbar .container {
        flex-wrap: wrap;
    }

    .navbar .navbar-toggler {
        display: none !important;
    }

    #navbarContent.navbar-collapse {
        display: block !important;
        flex-basis: 100%;
        margin-top: 0.45rem;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.1rem;
    }

    #navbarContent.navbar-collapse::-webkit-scrollbar {
        height: 4px;
    }

    #navbarContent .navbar-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.35rem;
        width: max-content;
        min-width: 100%;
        margin-bottom: 0 !important;
        padding-bottom: 0.15rem;
    }

    #navbarContent .nav-item {
        flex: 0 0 auto;
    }

    #navbarContent .nav-link {
        white-space: nowrap;
        padding: 0.42rem 0.72rem;
        font-size: 0.92rem;
    }

    .navbar-brand {
        font-size: 1.35rem;
    }

    .navbar-logo {
        width: 36px;
        height: 36px;
        font-size: 1.05rem;
    }
}
