/* 影视管理后台系统 - 主样式文件 */

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8fafc;
    color: #334155;
    line-height: 1.6;
}

/* 主容器布局 */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    overflow: hidden;
}

.sidebar-logo i {
    font-size: 1.5rem;
    color: #3b82f6;
    flex-shrink: 0;
    width: 1.75rem;
    text-align: center;
}

.logo-text {
    font-size: 1.125rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .logo-text {
    opacity: 0;
    width: 0;
}

.sidebar-collapse-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.sidebar-collapse-btn i {
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

/* 导航样式 */
.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav > ul > li {
    position: relative;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.sidebar-nav a i {
    font-size: 1.125rem;
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.nav-text {
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    width: 0;
}

.sidebar-nav > ul > li.active > a {
    background-color: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border-left-color: #3b82f6;
}

.sidebar-nav > ul > li.active > a i {
    color: #3b82f6;
}

/* 导航组样式 */
.nav-group {
    position: relative;
}

.nav-group-title {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.25rem;
    color: #94a3b8;
    font-weight: 500;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    justify-content: space-between;
}

.nav-group-title:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-group-title i:first-child {
    font-size: 1.125rem;
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.nav-group-title .nav-text {
    flex: 1;
}

.toggle-icon {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    opacity: 1;
}

.sidebar.collapsed .toggle-icon {
    opacity: 0;
    width: 0;
}

.nav-group.expanded .toggle-icon {
    transform: rotate(180deg);
}

/* 子菜单样式 */
.nav-submenu {
    background-color: rgba(0, 0, 0, 0.2);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-group.expanded > .nav-submenu {
    max-height: 500px;
}

.nav-submenu li {
    position: relative;
}

.nav-submenu a {
    padding-left: 3rem;
    font-size: 0.9rem;
}

.nav-submenu li.active > a {
    background-color: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border-left-color: #3b82f6;
}

/* 收起状态下隐藏子菜单 */
.sidebar.collapsed .nav-submenu {
    display: none;
}

.sidebar.collapsed .nav-group-title {
    justify-content: center;
}

.sidebar.collapsed .nav-group-title .nav-text {
    display: none;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
}

.sidebar.collapsed + .main-content {
    margin-left: 70px;
}

/* 头部样式 */
.main-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #64748b;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background-color: #f1f5f9;
    color: #334155;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.current-time {
    color: #64748b;
    font-size: 0.875rem;
}

/* 内容包装器 */
.content-wrapper {
    flex: 1;
    padding: 2rem;
    overflow-x: auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
}

/* 滚动条样式 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #1e293b;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}