:root {
    --bg-color: #0f0f0f;
    --card-bg: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --border-color: #333333;
    --sidebar-width: 260px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Layout */
.main-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: 40px;
    background-color: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 20px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

.content-area {
    flex-grow: 1;
    width: calc(100% - var(--sidebar-width) - 40px);
}

/* Sidebar Styles */
.sidebar-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.category-list {
    list-style: none;
}

.category-item {
    margin-bottom: 8px;
}

.category-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
    font-weight: 500;
}

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

.category-btn.active {
    background-color: var(--accent-color);
    color: white;
}

/* Tabs */
.tabs-container {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 600;
    padding: 8px 12px;
    cursor: pointer;
    position: relative;
    transition: color 0.3s;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--accent-color);
    border-radius: 3px 3px 0 0;
}

/* Business Layout & Card Styles (Restored) */
.business-layout .grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding-bottom: 40px;
}

.business-card {
    background-color: #0a0a0a; /* Very dark grey from original */
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
    height: auto; /* Let content dictate height */
}

.business-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border-color: rgba(255,255,255,0.15);
}

.business-card .media-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; 
    background-color: #050505;
    overflow: hidden;
}

.business-card .media-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.business-card.video-loaded .media-container video {
    opacity: 1;
}

/* Loading Spinner for Business Card */
.business-card .loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}

.business-card.video-loaded .loading-spinner {
    display: none;
}

/* Play Overlay */
.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    transition: background 0.3s;
    cursor: pointer;
    opacity: 1;
    z-index: 2;
}

.business-card:hover .play-overlay {
    background: rgba(0,0,0,0.1);
}

.play-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.2s;
}

.business-card:hover .play-icon {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

.play-icon svg {
    width: 28px;
    height: 28px;
    fill: white;
    margin-left: 4px;
}

.business-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.business-content .card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 46px; 
    line-height: 1.5;
    color: #eee;
}

.business-content .tags {
    display: flex;
    gap: 8px;
    margin-bottom: 0; /* Reset bottom margin */
    flex-wrap: wrap;
}

.business-content .tag {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.business-content .tag.gold {
    background-color: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

/* Business Modal Styles */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.8); 
    backdrop-filter: blur(8px);
}

.modal-content {
    background-color: #111;
    margin: 5% auto; 
    border: 1px solid rgba(255,255,255,0.1);
    width: 90%; 
    max-width: 1000px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-inner {
    display: flex;
    flex-direction: column;
    position: relative;
    height: 80vh; /* Limit height */
}

@media (min-width: 768px) {
    .modal-inner {
        flex-direction: row;
    }
}

.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}

.close-button:hover,
.close-button:focus {
    color: #fff;
    text-decoration: none;
}

.modal-video-section {
    flex: 2;
    background: black;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(255,255,255,0.05);
    min-height: 300px;
}

.modal-video-section video {
    width: 100%;
    height: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.modal-info-section {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: #111;
    border-radius: 0 0 24px 24px;
}

@media (min-width: 768px) {
    .modal-info-section {
        border-radius: 0 24px 24px 0;
        min-width: 350px;
    }
}

.modal-info-section h2 {
    font-size: 24px;
    margin-bottom: 24px;
    line-height: 1.3;
    background: linear-gradient(to right, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.info-group {
    margin-bottom: 30px;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.info-group h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    margin-bottom: 0; /* Handled by group-header if present, else override below */
}

.info-group > h3 {
    margin-bottom: 12px;
}

.prompt-text-modal {
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #ddd;
    background: rgba(255,255,255,0.03);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}

.ref-image-container {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}

.ref-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

.icon-button {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-button:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

/* Responsive Sidebar for Official View */
header {
    padding: 60px 0 40px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(to right, #fff, #a0a0a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding-bottom: 60px;
}

.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-color);
}

.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background-color: #000;
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.category-tag {
    display: inline-block;
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--accent-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 12px;
    align-self: flex-start;
}

.description-cn {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.prompt-box {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
    margin-top: auto;
    position: relative;
    border: 1px solid var(--border-color);
}

.prompt-text {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-height: 100px;
    overflow-y: auto;
    margin-bottom: 35px; /* Space for button */
    word-break: break-word;
}

.copy-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.copy-btn:hover {
    background-color: var(--accent-hover);
}

.copy-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent-color);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.toast.show {
    opacity: 1;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive */
@media (max-width: 900px) {
    .main-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: relative;
        top: 0;
        max-height: none;
        padding: 15px;
    }
    
    .category-list {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .category-item {
        margin-bottom: 0;
        flex-grow: 1;
    }
    
    .category-btn {
        text-align: center;
    }
    
    .content-area {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
}
