/* Enhanced Styles for AIGC Portfolio - v3 (Portfolio Aspect Ratio Update) */
/* Main Font: Noto Sans SC (already linked in HTML) */

/*
Color Palette:
- Background: bg-slate-950 (#020617)
- Primary Text: text-slate-200 (#e2e8f0)
- Accent Cyan: text-cyan-400 (#22d3ee), border-cyan-500, bg-cyan-500
- Accent Purple: text-purple-400 (#c084fc), border-purple-500, bg-purple-600
- Accent Pink: text-pink-500 (#ec4899)
- Subtle UI: slate-700 (#334155), slate-800 (#1e293b), slate-900 (#0f172a)
- Glows/Shadows: Utilising cyan and purple for depth
*/

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #020617; /* Equivalent to Tailwind's slate-950 for a deeper base */
    color: #e2e8f0; /* slate-200 */
    overflow-x: hidden; /* Prevent horizontal scrollbars */
}

/* Page Transitions */
.page {
    transition: transform 0.35s ease-in-out, opacity 0.35s ease-in-out; /* 动画时间和效果 */
    width: 100%;
    min-height: calc(100vh - 4rem - 3.25rem);
    /* display: none; /* Initially hide all pages except active */
}
.page.active-page {
    position: relative; /* 活动页面应在文档流中 */
    z-index: 1;
}
.page:not(.active-page) {
    opacity: 0;
    pointer-events: none;
    position: absolute; 
    width: 100%;
    top:0; /* Ensure non-active pages are positioned correctly for transition */
    left:0;
    z-index: 1;
}


/* Navigation Bar */
#main-nav {
    background-color: rgba(2, 6, 23, 0.6); /* slate-950 with transparency */
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(14, 165, 233, 0.1); /* Deeper shadow + cyan glow */
    height: 4.5rem; /* 72px */
}
@media (min-width: 768px) {
    #main-nav {
        height: 5.5rem; /* 88px */
    }
    #app-container {
        padding-top: 5.5rem; /* Adjust main content padding for fixed nav */
    }
    .page {
         min-height: calc(100vh - 5.5rem - 4.5rem); /* nav height - footer height approx */
    }
}
@media (max-width: 767px) {
    #app-container {
        padding-top: 4.5rem; /* Adjust main content padding for fixed nav */
    }
     .page {
         min-height: calc(100vh - 4.5rem - 4.5rem); /* nav height - footer height approx */
    }
}

#app-container {
    position: relative; /* 确保子元素的绝对定位是相对于此容器 */
    overflow-x: hidden; /* 防止页面切换时出现水平滚动条 */
}

#main-nav.scrolled {
    background-color: rgba(2, 6, 23, 0.85); /* More opaque on scroll */
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4), 0 0 50px rgba(14, 165, 233, 0.15);
}

/* Nav Link Active State */
.nav-link.active-nav-item {
    background-color: rgba(14, 165, 233, 0.15); /* Subtle cyan background */
    color: #22d3ee; /* cyan-400 */
    border-radius: 0.375rem; /* rounded-md */
    box-shadow: inset 0 0 10px rgba(14, 165, 233, 0.2), 0 0 15px rgba(14, 165, 233, 0.1);
}
#desktop-nav-links .nav-link:not(.active-nav-item):hover,
#mobile-menu .nav-link:not(.active-nav-item):hover {
    background-color: rgba(30, 41, 59, 0.5); /* slate-800 with transparency */
}


/* Homepage Hero Section */
#home-page h1 {
    text-shadow: 0 0 15px rgba(14, 165, 233, 0.3), 0 0 30px rgba(168, 85, 247, 0.2);
}

/* Homepage Diamond/Preview Items */
.diamond-container {
    position: relative;
    width: 100%; 
    aspect-ratio: 1 / 1; 
    cursor: pointer;
    overflow: hidden;
    border-radius: 1rem; 
    background-color: #1e293b; 
    box-shadow: 0 8px 15px rgba(0,0,0,0.2), 0 0 20px rgba(14, 165, 233, 0.1);
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.diamond-container:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 12px 25px rgba(0,0,0,0.3), 0 0 30px rgba(14, 165, 233, 0.25), 0 0 40px rgba(168, 85, 247, 0.15);
}

.diamond-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%); 
    transition: clip-path 0.4s ease-in-out, transform 0.4s ease-in-out;
    transform-origin: center center;
}

.diamond-container:hover .diamond-image {
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); 
    transform: scale(1.1);
}

.diamond-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.9) 25%, rgba(2, 6, 23, 0) 100%);
    color: white;
    padding: 1.5rem 1rem 1rem; 
    text-align: center;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
    pointer-events: none;
}
.diamond-overlay h3 {
    font-weight: 600;
    color: #67e8f9; 
}
.diamond-overlay p {
    font-size: 0.875rem;
    color: #94a3b8; 
}

.diamond-container:hover .diamond-overlay {
    opacity: 1;
    transform: translateY(0);
}
.diamond-container-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #334155; 
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b; 
    font-size: 0.8rem;
    text-align: center;
}


/* Portfolio Page & Items */
#portfolio-page, #ai-video-creation-page { /* Apply common page styling */
    background-color: #0f172a; /* slate-900 */
    /* padding-top and padding-bottom are handled by section specific classes if needed, or by app-container's padding */
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem; 
    background-color: #1e293b; 
    box-shadow: 0 6px 12px rgba(0,0,0,0.25), 0 0 15px rgba(14, 165, 233, 0.05);
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.portfolio-image-container {
    width: 100%;
    height: 280px; 
    overflow: hidden;
    border-radius: 0.75rem 0.75rem 0 0; 
    background-color: #111827; 
    position: relative; 
    cursor: pointer; 
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), filter 0.4s ease;
}

.portfolio-item.info-active .portfolio-image-container {
    transform: scale(0.95); 
    filter: brightness(0.8); 
}

img.portfolio-main-image {
    display: block;
    width: 100%;
    height: 100%; 
    object-fit: contain; 
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: inherit; 
}

.portfolio-item:not(.info-active):hover img.portfolio-main-image {
    transform: scale(1.05); 
}


.portfolio-info-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 45%; 
    background: linear-gradient(to top, rgba(15, 23, 42, 0.98) 70%, rgba(15, 23, 42, 0.8) 100%); 
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: white;
    padding: 1.25rem; 
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.3s ease-out, transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-top: 1px solid rgba(51, 65, 85, 0.7); 
    display: flex;
    flex-direction: column;
    justify-content: center;
    pointer-events: none; 
    z-index: 1; 
}

.portfolio-item.info-active .portfolio-info-panel {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto; 
}

.portfolio-info-panel .info-title {
    font-size: 1.75rem; 
    font-weight: 700; 
    color: #67e8f9; 
    margin-bottom: 0.5rem; 
    text-decoration: underline;
    text-decoration-color: #a855f7; 
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    transition: color 0.3s ease;
}
.portfolio-info-panel .info-title:hover {
    color: #c084fc; 
}

.portfolio-info-panel .info-description {
    font-size: 0.95rem; 
    color: #cbd5e1; 
    line-height: 1.6;
    max-height: 100px; 
    overflow-y: auto; 
}
.portfolio-info-panel .info-description::-webkit-scrollbar { width: 6px; }
.portfolio-info-panel .info-description::-webkit-scrollbar-track { background: rgba(51, 65, 85, 0.5); border-radius: 3px; }
.portfolio-info-panel .info-description::-webkit-scrollbar-thumb { background: #67e8f9; border-radius: 3px; }

.portfolio-zoom-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(14, 165, 233, 0.6); 
    color: white;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8) translateZ(0); 
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
    z-index: 5; 
    pointer-events: none; 
}
.portfolio-item.info-active .portfolio-zoom-button {
    opacity: 1;
    transform: scale(1) translateZ(0);
    pointer-events: auto; 
}
.portfolio-zoom-button:hover {
    background-color: rgba(168, 85, 247, 0.8); 
    transform: scale(1.15) translateZ(0); 
}


.portfolio-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(30, 41, 59, 0.7); 
    color: #94a3b8; 
    padding: 0.75rem;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.portfolio-nav-arrow:hover {
    background-color: #0ea5e9; 
    color: white;
    transform: translateY(-50%) scale(1.1);
}
.portfolio-nav-arrow.left-0 { left: -15px; }
.portfolio-nav-arrow.right-0 { right: -15px; }
@media (max-width: 767px) {
    .portfolio-nav-arrow.left-0 { left: 5px; }
    .portfolio-nav-arrow.right-0 { right: 5px; }
}

.portfolio-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #475569; 
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin: 0 5px;
}
.portfolio-dot.active {
    background-color: #0ea5e9; 
    transform: scale(1.3);
}

/* Category Filters - Updated for horizontal scroll */
#category-filters-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden; /* To hide the native scrollbar if you only want the custom one */
}
#category-filters-container {
    display: flex;
    overflow-x: auto; /* Enable horizontal scrolling */
    white-space: nowrap; /* Keep items in one line */
    padding-bottom: 10px; /* Space for scrollbar if it becomes visible */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    /* Custom scrollbar styling */
    scrollbar-width: thin; /* For Firefox */
    scrollbar-color: #475569 #1e293b; /* thumb track - For Firefox */
}
/* Webkit (Chrome, Safari, Edge) scrollbar styling */
#category-filters-container::-webkit-scrollbar {
    height: 6px; /* Height of the horizontal scrollbar */
}
#category-filters-container::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5); /* slate-800 with opacity */
    border-radius: 3px;
}
#category-filters-container::-webkit-scrollbar-thumb {
    background: #475569; /* slate-600 */
    border-radius: 3px;
}
#category-filters-container::-webkit-scrollbar-thumb:hover {
    background: #64748b; /* slate-500 */
}

.filter-btn {
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem; 
    font-weight: 500; 
    background-color: #334155; 
    color: #cbd5e1; 
    flex-shrink: 0; /* Important for flex items in a scrollable container */
}
.filter-btn:hover {
    background-color: #475569; 
    color: white;
    transform: translateY(-2px);
}
.filter-btn.active {
    background-color: #0ea5e9; 
    color: white;
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.4), 0 0 25px rgba(14, 165, 233, 0.2);
    transform: translateY(-2px);
}

/* AI Assistant Page */
#ai-assistant-page {
    background-color: #0f172a; 
}
#ai-assistant-page aside {
    background-color: rgba(2, 6, 23, 0.5); 
    border-right: 1px solid rgba(51, 65, 85, 0.5); 
}
.ai-nav-link {
    transition: background-color 0.3s ease, color 0.3s ease, padding-left 0.3s ease;
}
.ai-nav-link.active-ai-nav {
    background-color: rgba(14, 165, 233, 0.15); 
    color: #67e8f9; 
    padding-left: 1.5rem; 
    border-left: 3px solid #0ea5e9; 
}
.ai-content-panel {
    animation: fadeInPanel 0.5s ease-in-out forwards;
}
@keyframes fadeInPanel {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
.ai-file-input {
    display: block; width: 100%; padding: 0.75rem 1rem; font-size: 0.875rem; font-weight: 400;
    line-height: 1.5; color: #cbd5e1; background-color: #1e293b; background-clip: padding-box;
    border: 1px solid #334155; appearance: none; border-radius: 0.5rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}
.ai-file-input::-webkit-file-upload-button {
    padding: 0.75rem 1rem; margin: -0.75rem -1rem; margin-inline-end: 1rem; color: white;
    background-color: #0ea5e9; border: 0; border-radius: 0.5rem 0 0 0.5rem; transition: background-color 0.2s ease;
}
.ai-file-input::-webkit-file-upload-button:hover { background-color: #0891b2; }
.ai-file-input:focus { border-color: #0ea5e9; outline: 0; box-shadow: 0 0 0 0.25rem rgba(14, 165, 233, 0.3); }
.ai-preview-wrapper {
    position: relative; width: 100%; aspect-ratio: 16 / 9; background-color: #1e293b; 
    border-radius: 0.5rem; display: flex; align-items: center; justify-content: center;
    overflow: hidden; border: 1px dashed #334155; 
}
.default-preview-icon { font-size: 3rem; color: #475569; }
.ai-media-preview { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 0.375rem; }
.ai-media-preview:not([src="#"]):not([src=""]) { display: block; }
.ai-media-preview[src="#"], .ai-media-preview[src=""] { display: none; }
.ai-media-preview:not([src="#"]):not([src=""]) + .default-preview-icon { display: none; }

.ai-text-input {
    display: block; width: 100%; padding: 0.75rem 1rem; font-size: 0.875rem; color: #cbd5e1; 
    background-color: #1e293b; border: 1px solid #334155; border-radius: 0.5rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}
.ai-text-input:focus { border-color: #0ea5e9; outline: 0; box-shadow: 0 0 0 0.25rem rgba(14, 165, 233, 0.3); }
.ai-action-button {
    display: inline-flex; align-items: center; justify-content: center; padding: 0.625rem 1.25rem; 
    font-weight: 500; color: white; background: linear-gradient(to right, #0ea5e9, #6366f1); 
    border-radius: 0.5rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06), 0 0 15px rgba(14, 165, 233, 0.2);
    transition: all 0.3s ease; margin-bottom: 1rem;
}
.ai-action-button:hover {
    background: linear-gradient(to right, #0891b2, #4f46e5); 
    box-shadow: 0 6px 10px -1px rgba(0,0,0,0.15), 0 4px 6px -1px rgba(0,0,0,0.1), 0 0 20px rgba(14, 165, 233, 0.3);
    transform: translateY(-2px);
}
.ai-action-button:disabled { opacity: 0.5; cursor: not-allowed; transform: translateY(0); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06); }
.ai-result-box { background-color: #1e293b; padding: 1.5rem; border-radius: 0.5rem; min-height: 150px; box-shadow: inset 0 1px 3px rgba(0,0,0,0.2); }
.ai-result-text { color: #94a3b8; font-size: 0.9rem; line-height: 1.6; white-space: pre-wrap; }
.ai-result-text.text-green-500 { color: #22c55e; } 
.ai-result-text.text-red-500 { color: #ef4444; } 


/* Image Modal */
#image-modal { background-color: rgba(2, 6, 23, 0.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
#image-modal > div { background-color: #0f172a; border: 1px solid #334155; box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 50px rgba(14, 165, 233, 0.2); }
#close-modal { transition: color 0.3s ease, transform 0.3s ease; }
#close-modal:hover { color: #0ea5e9; transform: rotate(90deg) scale(1.1); }

.modal-info-container.overlay-mode {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 30%, rgba(15, 23, 42, 0) 100%);
    padding: 1.5rem; max-height: 40%; overflow-y: auto; border-radius: 0 0 0.75rem 0.75rem; 
}
.modal-info-container.overlay-mode #modal-title { color: #67e8f9; text-shadow: 0 0 8px rgba(14, 165, 233, 0.5); }
.modal-info-container.overlay-mode #modal-description { color: #e2e8f0; }
#modal-image { transition: transform 0.3s ease; object-fit: contain; max-width: 100%; max-height: 100%; }

/* Animations */
.animate-fade-in { animation: fadeInAnimation 0.7s ease-out forwards; opacity: 0;}
.animate-fade-in-down { animation: fadeInDownAnimation 0.7s ease-out forwards; opacity: 0; }
.animate-fade-in-up { animation: fadeInUpAnimation 0.7s ease-out forwards; opacity: 0; }
.animate-zoom-in { animation: zoomInAnimation 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; }

@keyframes fadeInAnimation { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInDownAnimation { from { opacity: 0; transform: translateY(-25px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUpAnimation { from { opacity: 0; transform: translateY(25px); } to { opacity: 1; transform: translateY(0); } }
@keyframes zoomInAnimation { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }

.animation-delay-300 { animation-delay: 0.3s; }
.animation-delay-500 { animation-delay: 0.5s; } 
.animation-delay-700 { animation-delay: 0.7s; } 

/* General Scrollbar Styling */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0f172a; border-radius: 10px; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 10px; border: 2px solid #0f172a; }
::-webkit-scrollbar-thumb:hover { background: #475569; }


/* Responsive Adjustments */
@media (max-width: 1023px) { 
    #hero-portfolio-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
     .portfolio-image-container { height: 260px; }
}

@media (max-width: 767px) { 
    #main-nav { height: 4rem; }
    #main-nav .container { padding-left: 1rem; padding-right: 1rem; }
    #home-page h1 { font-size: 3.5rem;  } 
    #home-page p { font-size: 1.125rem; } 
    #hero-portfolio-items { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
    .diamond-container, .diamond-container-placeholder { border-radius: 0.75rem; }
    #portfolio-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
    .portfolio-item { border-radius: 0.5rem; }
    .portfolio-image-container { height: 220px; }
    .portfolio-info-panel .info-title { font-size: 1.25rem; }
    .portfolio-info-panel .info-description { font-size: 0.875rem; }
    #ai-assistant-page .container { flex-direction: column; }
    #ai-assistant-page aside { max-height: none; margin-bottom: 1rem; border-right: none; border-bottom: 1px solid rgba(51, 65, 85, 0.5); }
    #ai-assistant-page main { padding: 1rem; }
    .ai-nav-link.active-ai-nav { padding-left: 1rem; border-left-width: 2px; }
    #image-modal > div { max-height: 95vh; flex-direction: column; }
    #image-modal #modal-image { max-height: 50vh; }
    #image-modal .modal-info-container { max-height: 40vh; text-align: center; }
    #image-modal .modal-info-container.overlay-mode { position: relative; background: transparent; padding: 1rem; }
}

@media (max-width: 480px) { 
    #home-page h1 { font-size: 2.5rem; }
    #home-page p { font-size: 1rem; }
    #hero-portfolio-items { grid-template-columns: repeat(1, minmax(0, 1fr)); }
    .portfolio-image-container { height: 200px; }
    .portfolio-nav-arrow { padding: 0.5rem; }
    .portfolio-info-panel { height: 50%; } 
    .portfolio-info-panel .info-title { font-size: 1.1rem; }
    .filter-btn { padding: 0.4rem 0.8rem; font-size: 0.875rem; }
    .ai-action-button { padding: 0.5rem 1rem; font-size: 0.875rem; }
}
.auth-modal {
    /* ... other styles ... */
    display: none; /* Or opacity: 0; visibility: hidden; pointer-events: none; */
    /* ... transition for opacity/transform if you want a fade-out ... */
}
.auth-modal.show {
    display: flex; /* Or your display type */
    /* opacity: 1; visibility: visible; pointer-events: auto; */
}