/* ===================================
   经典侧边栏导航布局样式
   =================================== */

/* 基础布局 */
body.sidebar-layout {
    background-color: #f5f7fa;
    color: #2c3e50;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    overflow-x: hidden;
}

/* 顶部导航栏 */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-left {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    width: 36px;
    height: 36px;
    filter: brightness(0) invert(1);
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-center {
    flex: 1;
    max-width: 600px;
    margin: 0 32px;
}

.search-bar {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.2);
    border-radius: 24px;
    padding: 8px 16px;
    backdrop-filter: blur(10px);
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    color: white;
    font-size: 14px;
    outline: none;
}

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

.search-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.search-btn:hover {
    background: rgba(255,255,255,0.2);
}

.header-right {
    display: flex;
    align-items: center;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-action-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.header-action-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.user-info {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 24px;
    cursor: pointer;
    margin-left: 16px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
}

.user-dropdown {
    position: absolute;
    top: calc(100% - 8px);
    right: 0;
    margin-top: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    min-width: 180px;
    display: none;
    overflow: hidden;
    z-index: 1000;
    /* 添加一个透明的连接区域，防止鼠标移动时菜单消失 */
    padding-top: 8px;
}

/* 显示下拉菜单 - 当悬停在用户信息区域或下拉菜单本身时 */
.user-info:hover .user-dropdown,
.user-dropdown:hover {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 12px 16px;
    color: #2c3e50;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
    /* 第一个链接的顶部边框创建圆角效果 */
}

.user-dropdown a:first-child {
    /* 覆盖透明padding区域，创建无缝连接 */
    margin-top: -8px;
    padding-top: 20px;
    /* 第一个元素保持圆角 */
    border-radius: 8px 8px 0 0;
}

.user-dropdown a:hover {
    background: #f8f9fa;
}

.dropdown-divider {
    height: 1px;
    background: #e9ecef;
    margin: 4px 0;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    width: 260px;
    background: white;
    border-right: 1px solid #e9ecef;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease;
    z-index: 999;
}

.sidebar-nav {
    padding: 16px 0;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #8b95a5;
    letter-spacing: 0.5px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
    position: relative;
}

.nav-link:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

.nav-item.active .nav-link {
    background: linear-gradient(90deg, #667eea20 0%, #764ba220 100%);
    color: #667eea;
    font-weight: 500;
}

.nav-item.active .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

.nav-text {
    flex: 1;
}

.nav-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.nav-arrow {
    margin-left: auto;
    transition: transform 0.2s;
}

.nav-item.expanded .nav-arrow {
    transform: rotate(180deg);
}

.nav-submenu {
    display: none;
    background: #f8f9fa;
}

.nav-item.expanded .nav-submenu {
    display: block;
}

.nav-sublink {
    display: block;
    padding: 8px 20px 8px 52px;
    color: #6c757d;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.nav-sublink:hover {
    background: #e9ecef;
    color: #2c3e50;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.version-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6c757d;
}

.version-label {
    opacity: 0.7;
}

.version-number {
    font-weight: 500;
}

.license-expired {
    width: 16px;
    height: 16px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 10px;
    cursor: help;
}

/* 主内容区域 */
.main-content {
    margin-left: 260px;
    margin-top: 64px;
    min-height: calc(100vh - 64px);
    padding: 24px;
}

.content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
}

/* 页面头部 */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.page-actions {
    display: flex;
    gap: 12px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 应用容器 */
.apps-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 12px;
    border: 2px dashed #e9ecef;
}

.empty-icon {
    color: #dee2e6;
    margin-bottom: 24px;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: #495057;
    margin: 0 0 8px 0;
}

.empty-state p {
    color: #6c757d;
    margin: 0 0 24px 0;
}

/* 统计卡片 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #f0f0f0;
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-blue {
    background: linear-gradient(135deg, #667eea20, #764ba220);
    color: #667eea;
}

.stat-green {
    background: #d4edda;
    color: #28a745;
}

.stat-orange {
    background: #fff3cd;
    color: #fd7e14;
}

.stat-red {
    background: #f8d7da;
    color: #dc3545;
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: #6c757d;
    margin-top: 4px;
}

/* 应用网格 */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.app-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #f0f0f0;
    transition: all 0.2s;
}

.app-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.app-card-header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-title-section {
    flex: 1;
}

.app-number {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 12px;
}

.app-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    display: inline;
}

.app-name {
    font-size: 13px;
    color: #6c757d;
    margin-left: 12px;
}

.collapse-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.collapse-btn:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

.app-content {
    padding: 20px;
}

.app-section {
    margin-bottom: 20px;
}

.app-section:last-child {
    margin-bottom: 0;
}

.app-section h4 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #8b95a5;
    margin: 0 0 12px 0;
    letter-spacing: 0.5px;
}

.app-icons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.app-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: block;
    transition: all 0.2s;
}

.app-icon:hover {
    transform: scale(1.1);
}

.app-actions {
    padding: 16px 20px;
    background: #f8f9fa;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: white;
    color: #495057;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #f8f9fa;
    color: #2c3e50;
    transform: translateY(-1px);
}

.action-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
}

.action-primary:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a4191);
    color: white;
}

.action-info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

.action-info:hover {
    background: #c3e6fd;
    color: #0c5460;
}

.action-danger {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.action-danger:hover {
    background: #f1b2b7;
    color: #721c24;
}

.action-warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.action-warning:hover {
    background: #ffecb5;
    color: #856404;
}

.action-disabled {
    background: #f8f9fa;
    color: #adb5bd;
    border-color: #dee2e6;
    cursor: not-allowed;
}

.action-disabled:hover {
    background: #f8f9fa;
    color: #adb5bd;
    transform: none;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .apps-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .header-center {
        margin: 0 16px;
    }

    .apps-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .top-header {
        padding: 0 16px;
    }

    .header-center {
        display: none;
    }

    .user-name {
        display: none;
    }

    .main-content {
        padding: 16px;
    }

    .page-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .stats-cards {
        grid-template-columns: 1fr;
    }

    .mobile-menu-btn {
        display: flex;
    }
}

/* 商铺页面样式 */
.filter-buttons {
    display: flex;
    gap: 12px;
}

.btn-outline {
    background: white;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.btn-outline:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.asset-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #f0f0f0;
    transition: all 0.2s;
}

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

.asset-cover {
    position: relative;
    overflow: hidden;
}

.asset-image {
    width: 100%;
    height: auto;
    transition: transform 0.3s;
}

.asset-card:hover .asset-image {
    transform: scale(1.05);
}

.asset-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

.asset-badge-blender {
    background: linear-gradient(135deg, #f57c00, #e65100);
}

.asset-badge-3dsmax {
    background: linear-gradient(135deg, #1976d2, #0d47a1);
}

.asset-badge-maya {
    background: linear-gradient(135deg, #388e3c, #1b5e20);
}

.asset-price {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    background: rgba(0,0,0,0.7);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.asset-content {
    padding: 20px;
}

.asset-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 8px 0;
}

.asset-type {
    display: inline-block;
    padding: 4px 8px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 12px;
}

.asset-description {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 20px 0;
}

.asset-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* 网络目录页面样式 */
.network-container {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #f0f0f0;
}

.file-browser {
    display: flex;
    flex-direction: column;
    height: 600px;
}

.browser-header {
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.browser-path {
    flex: 1;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 12px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.browser-content {
    flex: 1;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    padding: 16px;
    height: 100%;
    overflow-y: auto;
}

.file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.file-item:hover {
    background: #f8f9fa;
}

.file-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.file-name {
    font-size: 11px;
    color: #495057;
    word-break: break-all;
    line-height: 1.2;
}

.file-icon-folder {
    background: #fff3cd;
    color: #856404;
}

.file-icon-image {
    background: #d1ecf1;
    color: #0c5460;
}

.file-icon-model {
    background: #d4edda;
    color: #155724;
}

.file-icon-file {
    background: #e2e3e5;
    color: #383d41;
}

@media (max-width: 1200px) {
    .store-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .filter-buttons {
        flex-wrap: wrap;
    }

    .store-grid {
        grid-template-columns: 1fr;
    }

    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 8px;
    }

    .file-item {
        padding: 8px;
    }

    .file-icon {
        width: 36px;
        height: 36px;
    }

    .file-name {
        font-size: 10px;
    }
}

/* 应用详情页面样式 */
.app-detail-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.app-info-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #f0f0f0;
}

.app-info-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 20px 0;
}

.info-grid {
    display: grid;
    gap: 16px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-label {
    font-size: 14px;
    color: #6c757d;
    min-width: 80px;
}

.info-value {
    font-size: 14px;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
}

.file-resources-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.resource-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #f0f0f0;
}

.resource-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.2s;
}

.file-item:hover {
    background: #e9ecef;
}

.file-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    position: relative;
    color: white;
}

.file-icon-html {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.file-icon-model {
    background: linear-gradient(135deg, #388e3c, #1b5e20);
}

.main-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-info {
    flex: 1;
}

.file-name {
    font-size: 13px;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
    margin-bottom: 4px;
    word-break: break-all;
}

.file-type {
    font-size: 11px;
    color: #6c757d;
    font-weight: 500;
}

.file-actions {
    display: flex;
    gap: 8px;
}

@media (max-width: 992px) {
    .file-resources-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .info-label {
        min-width: auto;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .file-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    margin-right: 8px;
}

.mobile-menu-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.mobile-menu-btn:active {
    transform: translateY(0);
    background: rgba(255,255,255,0.25);
}

.mobile-menu-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s;
}

.mobile-menu-btn:hover svg {
    transform: scale(1.05);
}

@media (max-width: 576px) {
    .app-actions {
        gap: 4px;
    }

    .action-btn {
        padding: 6px 8px;
        font-size: 11px;
    }

    .action-btn svg {
        width: 14px;
        height: 14px;
    }

    .file-name {
        font-size: 12px;
    }

    .resource-section {
        padding: 16px;
    }
}