:root {
    --primary: #1e293b;
    --primary-light: #334155;
    --accent: #2563eb;
    --accent-light: #dbeafe;
    --secondary: #059669;
    --warm: #e11d48;
    --bg-light: #f8fafc;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-light: #64748b;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --card-hover-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --sidebar-width: 260px;
    --sidebar-mobile-width: 70px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

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

body {
    font-family: 'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    min-height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Watermark */
.watermark {
    position: fixed;
    bottom: 30px;
    right: 30px;
    font-family: 'Noto Serif SC', serif;
    font-weight: 700;
    font-size: 3rem;
    color: rgba(255, 0, 0, 0.15);
    pointer-events: none;
    z-index: 9999;
    user-select: none;
    letter-spacing: 2px;
}

@media (max-width: 900px) {
    .watermark {
        display: none;
    }
}

/* Background Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.08;
    animation: pulse 20s infinite alternate;
}

.blob-1 { width: 600px; height: 600px; background: var(--primary); top: -200px; left: -100px; }
.blob-2 { width: 500px; height: 500px; background: var(--secondary); bottom: -150px; right: -100px; animation-delay: -3s; }
.blob-3 { width: 400px; height: 400px; background: var(--accent); top: 30%; right: 15%; animation-delay: -7s; }

@keyframes pulse {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.15) translate(30px, 30px); }
}

/* Layout */
.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

.mobile-header {
    display: none;
}

.layout-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: #fdf8eb; /* Cream background from image */
    border-right: 1px solid #f2ead8;
    display: flex;
    flex-direction: column;
    padding: 2rem 1rem;
    z-index: 100;
}

.sidebar-header {
    margin-bottom: 3rem;
    text-align: center;
}

.sidebar-header h1 {
    font-weight: 800;
    font-size: 1.5rem;
    color: #4a6741; /* Dark green from image */
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
}

.menu-group {
    margin-bottom: 2rem;
}

.menu-group-title {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #5c7c52;
    margin-bottom: 0.8rem;
    padding: 0.5rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    border-radius: 8px;
}

.menu-group-title:hover {
    background: rgba(74, 103, 65, 0.05);
}

.diamond-icon {
    font-size: 0.7rem;
    margin-right: 8px;
    color: #4d96ff;
}

.chevron-icon {
    margin-left: auto;
    font-size: 0.7rem;
    opacity: 0.5;
    transition: transform 0.3s ease;
}

.menu-group.collapsed .chevron-icon {
    transform: rotate(-90deg);
}

.menu-list {
    list-style: none;
    padding: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.2s;
    max-height: 500px; /* Large enough to fit content */
    opacity: 1;
}

.menu-group.collapsed .menu-list {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
}

.menu-list li {
    margin-bottom: 0.2rem;
}

.menu-list li a {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.8rem;
    text-decoration: none;
    color: #2c4c24;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s;
}

.menu-icon {
    margin-right: 10px;
    font-size: 1.1rem;
}

.menu-list li:hover a {
    background: rgba(74, 103, 65, 0.05);
}

.menu-list li.active a {
    color: #4a6741;
    font-weight: 700;
}

.sidebar-footer {
    padding-top: 2rem;
    text-align: center;
    border-top: 1px dashed #e5dcc3;
}

.qr-container {
    background: white;
    padding: 8px;
    border-radius: 8px;
    width: 140px;
    height: 140px;
    margin: 0 auto 10px;
}

.qr-container img {
    width: 100%;
    height: 100%;
}

.studio-name {
    font-size: 0.85rem;
    color: #7d9674;
    font-weight: 500;
}

/* Main Content Styling */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #ffffff;
}

.content-header {
    background: white;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4a6741;
}

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

.page-title h2 {
    font-size: 1.3rem;
    font-weight: 700;
}

.search-container {
    position: relative;
    width: 300px;
}

#searchInput {
    width: 100%;
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    background: #f5f5f5;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

#searchInput:focus {
    background: white;
    border-color: #eee;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.3;
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filter-row {
    display: flex;
    align-items: center;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.filter-btn {
    padding: 0.4rem 1rem;
    background: #f5f5f5;
    border: none;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    width: auto;
    text-align: center;
    white-space: nowrap;
}

.filter-btn:hover {
    background: #eeeeee;
}

.filter-btn.active {
    background: #4d96ff;
    color: white;
    box-shadow: 0 4px 10px rgba(77, 150, 255, 0.3);
}

.filter-count {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-left: 4px;
}

.grid-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.75rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

/* Card Styling */
.card {
    background: #ffffff;
    border: 1px solid #eeeeee;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.card-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f5f5f5;
    border-bottom: 1px solid #f0f0f0;
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-cover.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
}

.card-icon {
    font-size: 3rem;
    opacity: 0.3;
}

.card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

.card h3 {
    font-weight: 700;
    font-size: 1.1rem;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-subtitle {
    font-size: 0.9rem;
    color: #888888;
}

.card-stats {
    margin-top: auto;
    padding-top: 0.8rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #999999;
    font-size: 0.85rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-item svg {
    opacity: 0.6;
}

.stat-action {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

.stat-action:hover,
.stat-action:focus-visible {
    color: #2563eb;
    transform: translateY(-1px);
    outline: none;
}

/* Mobile Optimizations */
@media (max-width: 900px) {
    .mobile-header {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 0.8rem 1.2rem;
        background: #fdf8eb;
        border-bottom: 1px solid #f2ead8;
        z-index: 200;
    }

    .sidebar-toggle-btn {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
    }

    .sidebar-toggle-btn span {
        width: 100%;
        height: 2px;
        background: #4a6741;
        border-radius: 2px;
        transition: all 0.3s;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        width: 260px;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 30px rgba(0,0,0,0.1);
        border-right: none;
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        backdrop-filter: blur(4px);
        z-index: 90;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .layout-main {
        position: relative;
    }
}

@media (max-width: 600px) {
    .content-header {
        padding: 1rem;
        gap: 0.8rem;
    }

    .header-top {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }

    .page-title h2 {
        font-size: 1rem;
    }

    .search-container {
        width: 150px;
    }

    #searchInput {
        padding: 0.4rem 1.8rem 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

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

    .filter-row {
        position: relative;
        width: 100%;
        overflow: hidden;
        margin-right: -1rem; /* Allow scroll to edge */
    }

    .filter-pills {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 8px;
        padding-right: 3rem;
        gap: 0.6rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .filter-pills::-webkit-scrollbar {
        display: none;
    }

    /* Fade indicator for horizontal scroll */
    .filter-row::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 8px;
        width: 40px;
        background: linear-gradient(to right, transparent, #ffffff);
        pointer-events: none;
        z-index: 5;
    }

    .filter-btn {
        padding: 0.35rem 0.8rem;
        font-size: 0.75rem;
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
}

footer {
    padding: 1rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.75rem;
}

/* Floating Contact Card Redesign (Synced from Set 1) */
.contact-card {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.card-toggle {
    background: #FF6B6B; /* --warm color from Set 1 */
    color: white;
    padding: 0.8rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(255, 107, 107, 0.4);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-toggle:hover {
    transform: scale(1.05) translateY(-3px);
    box-shadow: 0 15px 30px rgba(255, 107, 107, 0.5);
}

.card-content {
    background: white;
    padding: 1.5rem;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    margin-bottom: 1rem;
    display: none;
    width: 280px;
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.contact-card.active .card-content {
    display: block;
}

/* PC Hover effect */
@media (min-width: 1025px) {
    .contact-card:hover .card-content {
        display: block;
    }
}

.card-content .avatar {
    font-size: 3.5rem;
    width: 80px;
    height: 80px;
    background: #fff8e6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 15px rgba(255, 217, 61, 0.2);
}

.card-content .info {
    text-align: center;
}

.card-content .info h4 {
    font-family: 'ZCOOL KuaiLe', cursive;
    font-size: 1.4rem;
    color: #2D3436;
    margin-bottom: 0.5rem;
}

.card-content .wechat {
    background: #f0fdf4;
    color: #16a34a;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: inline-block;
    border: 1px solid #dcfce7;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.card-content .wechat:active {
    transform: scale(0.95);
}

.card-content .wechat span {
    font-weight: 700;
    user-select: all;
}

.card-content .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.card-content .tags span {
    background: #f1f5f9;
    color: #64748b;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .contact-card {
        bottom: 1rem;
        right: 1rem;
    }
    
    .card-content {
        width: 240px;
        padding: 1.2rem;
    }
    
    .card-toggle {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
}

/* Auth Overlay Styles */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 52, 54, 0.4);
    backdrop-filter: blur(20px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-overlay.show {
    opacity: 1;
    visibility: visible;
}

.auth-modal {
    background: white;
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    text-align: center;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-overlay.show .auth-modal {
    transform: translateY(0);
}

.auth-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    background: var(--accent-light);
    color: var(--accent);
    width: 64px;
    height: 64px;
    line-height: 64px;
    border-radius: var(--radius-md);
    margin-left: auto;
    margin-right: auto;
}

.auth-header h2 {
    font-family: 'Noto Serif SC', serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.auth-header p {
    color: #636E72;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.auth-body {
    margin-bottom: 1.5rem;
}

.auth-tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.auth-tab-btn {
    flex: 1;
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 12px;
    background: #f1f3f5;
    color: var(--text-light);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-tab-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px rgba(77, 150, 255, 0.25);
}

.auth-panel {
    display: none;
}

.auth-panel.active {
    display: block;
}

.input-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    font-size: 1rem;
    text-align: center;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.05em;
    transition: all 0.2s;
    background: #f8fafc;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent);
    background: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.verify-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
}

.verify-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.verify-btn.secondary {
    background: var(--secondary);
    box-shadow: 0 4px 15px rgba(107, 203, 119, 0.3);
}

.verify-btn.secondary:hover {
    background: #57b863;
    box-shadow: 0 6px 20px rgba(107, 203, 119, 0.4);
}

.verify-btn.ghost {
    background: white;
    color: var(--text-main);
    border: 1px solid #dfe6e9;
    box-shadow: none;
}

.verify-btn.ghost:hover {
    background: #f8f9fa;
    box-shadow: none;
}

.verify-btn:active {
    transform: translateY(0);
}

.register-panel {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: #f8fbff;
    border: 1px solid rgba(37, 99, 235, 0.1);
}

.register-panel.show {
    display: block;
}

.register-tip {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

.input-group.compact {
    margin-top: 0.75rem;
}

.auth-error-msg {
    color: #FF6B6B;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    min-height: 1.2rem;
    display: none;
}

.auth-footer {
    border-top: 1px solid #f1f5f9;
    padding-top: 1rem;
    margin-top: 1.5rem;
}

.auth-footer p {
    color: #999;
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
}

.contact-info {
    font-weight: bold;
    color: #4D96FF;
    font-size: 0.9rem;
}

/* Prevent interacting with background when auth is active */
body.auth-locked {
    overflow: hidden;
}

body.auth-locked .app-layout {
    filter: blur(5px);
    pointer-events: none;
}

